QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#209514 | #7112. XOR Clique | PetroTarnavskyi# | WA | 0ms | 3604kb | C++17 | 1.2kb | 2023-10-10 15:28:08 | 2023-10-10 15:28:09 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;
void solve()
{
LL a, b, c, d, v, t;
cin >> a >> b >> c >> d >> v >> t;
LL lcm = a * c / gcd(a, c);
LL counter = 0, i = 1, j = 1, lastLED = 0, lastBlock = 0;
while (i * a < lcm)
{
LL ia = i * a, jc = j * c;
if (ia <= jc)
{
counter += b;
if (ia - lastLED > v)
counter--;
lastLED = ia;
if (ia <= t % lcm)
lastBlock = counter;
i++;
}
if (jc <= ia)
{
counter += d;
if (jc - lastLED > v)
counter--;
lastLED = jc;
if (jc <= t % lcm)
lastBlock = counter;
j++;
}
}
cout << b + d - 1 + (t / lcm) * counter + lastBlock << "\n";
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout << fixed << setprecision(15);
int t;
cin >> t;
while (t--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3604kb
input:
3 3 1 2 3 3 1 1 1 5 1 2323 534 534 5
output:
3 429 116
result:
wrong answer 1st numbers differ - expected: '2', found: '3'