#include "cmp.h"
#include <iostream>
using namespace std;
void remember(int a) {
int cnt2 = 4;
while (cnt2 > 0) {
bit_set(1+ (cnt2 - 1) * 8 +a % 8);
a >>= 3 , cnt2--;
}
}
int compare(int b) {
for (int i = 1; i <= 4; i++) {
int i2 = 12-3 * i;
int val = (b >> i2) % 8;
int readed = bit_get(1 + (i - 1) * 8 + val);
if (readed == 0) {
if (val < 4) {
for (int j = 0; j < val; j++) if (bit_get(1 + (i - 1) * 8 + j) == 1) return 1;
return -1;
}
else {
for (int j = 7; j > val; j--) if (bit_get(1 + (i - 1) * 8 + j) == 1) return -1;
return 1;
}
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1273 ms |
82496 KB |
Output is partially correct - maxAccess = 11, score = 91 |