# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
229837 |
2020-05-06T19:24:58 Z |
edsa |
CATS (NOI14_cats) |
C++17 |
|
83 ms |
2392 KB |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
ll n, l, x, t;
int main () {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> t;
while (t--) {
cin >> x >> l >> n;
n<<=1;
ll k = l/n+1, zeros = k+2+(k&1);
--x;
if (k <= 60) x = x&((1LL<<(k+1))-1);
zeros -= __builtin_popcountll(x);
cout << k*n+(zeros&1) << "\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Correct |
4 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
444 KB |
Output is correct |
2 |
Correct |
10 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
75 ms |
2244 KB |
Output is correct |
2 |
Correct |
83 ms |
2392 KB |
Output is correct |