# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
727933 | rainboy | CATS (NOI14_cats) | C11 | 73 ms | 2200 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
int count(long long b) {
return b == 0 ? 0 : count(b & b - 1) + 1;
}
int main() {
int t;
scanf("%d", &t);
while (t--) {
long long k, l, n, d;
scanf("%lld%lld%lld", &k, &l, &n), k--, d = (l + n * 2) / (n * 2);
printf("%lld\n", d * n * 2 + count(d >= 60 ? k : k % (1LL << d + 1)) % 2);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |