Submission #14674

#TimeUsernameProblemLanguageResultExecution timeMemory
14674nosiarCATS (NOI14_cats)C++14
16 / 25
1500 ms1716 KiB
#include <iostream> #include <cstring> #include <string> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <functional> #include <numeric> #include <limits> using namespace std; int x, l, n; int main() { #ifdef LOCAL freopen("input.txt", "r", stdin); #endif int tests; cin >> tests; while (tests--) { cin >> x >> l >> n; int k = l / (2 * n) + 1; x--; bool cur = true; int i = k; int asdf = (x % 2) ^ (x / 2); x /= 4; while (--i) { if (cur) { asdf ^= x % 2; } else { asdf ^= x / 2; x /= 4; } cur = !cur; } cout << 2 * k*n + (asdf&1) << endl; }}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...