#include "cmp.h"
const int K = 2;
void remember(int n) {
for (int i = 12 - K, j = 1; i > -1; i -= K, j *= (1 << K) + 1) {
int curr = ((n >> i) & ((1 << K) - 1)) + 1;
bit_set(curr + j);
}
}
int compare(int b) {
for (int i = 12 - K, j = 1; i > -1; i -= K, j *= (1 << K) + 1) {
int curr = ((b >> i) & ((1 << K) - 1)) + 1;
if (bit_get(curr + j)) continue;
for (int k = 1; k < curr; k++) if (bit_get(k + j)) return 1;
return -1;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1700 ms |
94840 KB |
Output is partially correct - maxAccess = 15, score = 55 |