# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
81581 |
2018-10-25T12:07:04 Z |
imeimi2000 |
cmp (balkan11_cmp) |
C++17 |
|
2065 ms |
83704 KB |
#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 |
1 |
Correct |
2065 ms |
83704 KB |
Output is correct - maxAccess = 10, score = 100 |