# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
4739 | kipa00 | cmp (balkan11_cmp) | C++98 | 2488 ms | 82476 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 value) {
int a[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int c = 12, cnt = 0;
while (c--) {
a[c] = value & 1;
if (value & 1) {
++cnt;
}
value >>= 1;
}
if (cnt > 6) {
bit_set(1);
for (c=0; c<12; ++c) {
if (!a[c]) bit_set(c + 2);
}
} else for (c=0; c<12; ++c) {
if (a[c]) bit_set(c + 2);
}
}
int compare (int value) {
int inverse = bit_get(1);
int i, num = 0;
for (i=0; i<12; ++i) {
num <<= 1;
num |= inverse ^ bit_get(i + 2);
}
if (value < num) {
return -1;
} else if (value == num) {
return 0;
}
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |