#include "cmp.h"
#include <algorithm>
using namespace std;
void remember(int n) {
int grp = n / 64;
grp++;
bit_set(grp);
bit_set(65 + n);
}
int compare(int b) {
int bGrp = b / 64;
bGrp++;
int aGrp = 0;
for (int i = 1; i <= 64; i++) {
if (i > bGrp) return -1;
if (bit_get(i)) {
aGrp = i;
break;
}
}
if (aGrp < bGrp) return 1;
int startG = (aGrp * 64) + 1;
int endG = startG + 63;
int a = -1;
b += 65;
for (int i = startG; i <= endG; i++) {
if (i > b) return -1;
if (bit_get(i)) {
a = i;
break;
}
}
if (a == b) return 0;
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3058 ms |
90768 KB |
ZERO POINTS: more than 20 accesses in the worst case |