# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
927589 | Muaath_5 | cmp (balkan11_cmp) | C++17 | 10004 ms | 106328 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.
#ifdef MUAATH_5
#include "ioi.h"
#else
#include "cmp.h"
#endif
const int SHIFT = (1 << 12);
void remember(int n) {
int cur = SHIFT;
for (int i = 11; i >= 0; i--) {
if (n & (1 << i)) {
cur += (1 << i);
bit_set(cur);
}
}
}
int compare(int b) {
int l = 0, r = 12;
int cur = 0;
while (l < r) {
const int md = (l + r + 1) / 2;
cur = SHIFT;
for (int i = 11; i >= md; i--)
if (b & (1 << i))
cur += (1 << i);
if (bit_get(cur))
l = 12-md;
else
r = 12-(md - 1);
}
if (l == 12) return 0;
l = 12 - l;
if (b & (1 << (l - 1))) return 1;
return -1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |