#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2065 ms |
83704 KB |
Output is correct - maxAccess = 10, score = 100 |