# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
43922 | dhkim0225 | cmp (balkan11_cmp) | C++14 | 988 ms | 85368 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 "cmp.h"
void remember(int n) {
n = n + 1;
int target = 2048;
int cnt = 1;
while (cnt <= 12) {
if (target < n) {
bit_set(target);
target += (target >> cnt);
}
else if (target > n) {
bit_set(target);
}
else {
bit_set(target);
break;
}
cnt++;
}
}
int compare(int b) {
int target = 2048;
int cnt = 1;
if (bit_get(target) == 1) {
while (cnt <= 12) {
if (bit_get(target + target >> cnt))
target += (target >> cnt);
else if (bit_get(target - target >> cnt))
target -= (target >> cnt);
else
break;
cnt++;
}
}
if (target > b)
return -1;
else if (target < b)
return 1;
else
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |