# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
43875 | kdk8361 | cmp (balkan11_cmp) | C++17 | 2055 ms | 82652 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"
int shif[4] = { 480,48,6,1 };
int base[4] = { 50,30,10,1 };
int bi[4] = { 8,9,7,5 };
void remember(int n) {
for (int i = 0; i < 4; i++) {
bit_set(base[i] + n / shif[i]);
n %= shif[i];
}
}
int compare(int b) {
int cur[4] = { 0, };
for (int i = 0; i < 4; i++) {
cur[i] = b / shif[i];
b %= shif[i];
}
for (int i = 0; i < 4; i++) {
if (bit_get(base[i] + cur[i]))
continue;
if (cur[i] > bi[i] / 2) {
int l = base[i] + cur[i] + 1, r = base[i] + bi[i];
for (; l <= r; l++)
if (bit_get(l)) return -1;
return 1;
}
int l = base[i], r = base[i] + cur[i] - 1;
for (; l <= r; l++)
if (bit_get(l)) return 1;
return -1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |