#include "cmp.h"
// a, b in [0,1<<12)
void remember(int a) { // a를 [1,10240]에 기록
for (int k = 0; k < 6; ++k) {
if ((a/64)>>k&1) bit_set(k+1);
}
int base = (a/64 + 1)*7;
bit_set(base);
for (int k = 1; k < 7; ++k) {
if ((a%64)>>(k-1)&1) bit_set(base+k);
}
}
int compare(int b) { // a와 b 비교
int base = (b/64 + 1)*7;
if (bit_get(base)) {
int a = (b/64) << 6;
for (int k = 1; k < 7; ++k) {
if (bit_get(base+k)) {
a |= 1<<(k-1);
}
}
if (b < a) return -1;
if (b == a) return 0;
if (b > a) return 1;
} else {
int a = 0;
for (int k = 0; k < 6; ++k) {
if (bit_get(k+1)) a |= (1<<k) * 64;
}
if (b < a) return -1;
if (b == a) return 0;
if (b > a) return 1;
}
return 100;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1576 ms |
83292 KB |
Output is partially correct - maxAccess = 20, score = 10 |