# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
125418 | 2019-07-05T09:34:46 Z | Touubs | CATS (NOI14_cats) | C++17 | 654 ms | 3404 KB |
#include <bits/stdc++.h> using namespace std; #define dout if(false) cout #define int unsigned long long void testcase() { int X, L, N; cin >> X >> L >> N; int originalX = X; X--; int level = L/(2*N) + 1; dout << "level: " << level << endl; int counterPerIter = ((2 << min(60ull, level))); dout << "counter per iter" << counterPerIter; int flips = 0; if (counterPerIter != 0) X = X % counterPerIter; dout << "counterPerIter: " << counterPerIter << endl; while (X > 0) { //cout << "X: " << X << ", flips: " << flips << " | "; if ((X & 1) == 1) flips = flips ^ 1; X = X >> 1; } dout << endl << "end. flips: " << flips << endl; int min = (L/(2*N) + 1) * (2*N); cout << ((min ^ ((flips) & 1))) << endl; } signed main() { int Q; cin >> Q; for (int i = 0; i < Q; i++) { testcase(); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 380 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 376 KB | Output is correct |
2 | Correct | 4 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 376 KB | Output is correct |
2 | Correct | 8 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 46 ms | 636 KB | Output is correct |
2 | Incorrect | 51 ms | 760 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 572 ms | 3404 KB | Output is correct |
2 | Incorrect | 654 ms | 3068 KB | Output isn't correct |