# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
24860 | chpipis | cmp (balkan11_cmp) | C++11 | 1640 ms | 82540 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"
const int BLOCK = (1 << 3);
const int SIZE = 12;
void remember(int n) {
for (int i = SIZE - 3, pos = 1; i >= 0; i -= 3, pos += BLOCK) {
int cur = (n >> i) & (BLOCK - 1);
bit_set(pos + cur);
}
}
int compare(int b) {
for (int i = SIZE - 3, pos = 1; i >= 0; i -= 3, pos += BLOCK) {
int cur = (b >> i) & (BLOCK - 1);
if (!bit_get(pos + cur)) {
if (cur <= 3) {
for (int j = 0; j < cur; j++) {
if (bit_get(pos + j))
return 1;
}
return -1;
} else {
for (int j = cur + 1; j < 8; j++) {
if (bit_get(pos + j))
return -1;
}
return 1;
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |