# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
81581 | imeimi2000 | cmp (balkan11_cmp) | C++17 | 2065 ms | 83704 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 radix[4] = { 6, 8, 10, 12 };
const int st[4] = { 100, 200, 300, 400 };
void remember(int a) {
for (int i = 0; i < 4; ++i) {
bit_set(a % radix[i] + st[i]);
a /= radix[i];
}
}
int compare(int b) {
int x[4];
for (int i = 0; i < 4; ++i) {
x[i] = b % radix[i];
b /= radix[i];
}
for (int i = 4; i--; ) {
if (bit_get(x[i] + st[i])) continue;
if ((x[i] << 1) < radix[i]) {
for (int j = 0; j < x[i]; ++j) if (bit_get(j + st[i])) return 1;
return -1;
}
else {
for (int j = radix[i]; --j > x[i]; ) if (bit_get(j + st[i])) return -1;
return 1;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |