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