#include "cmp.h"
#include <bits/stdc++.h>
using namespace std;
int d[6] = {1, 4097, 5121, 5377, 5441, 5457};
void remember(int x){
for(int i = 0; i < 6; ++i){
bit_set((x>>(2*i)) + d[i]);
}
}
int compare(int x){
int lo = 0, hi = 6;
while(lo < hi){
int m = (hi + lo) / 2;
int p = (x>>(2 * m)) + d[m];
if(bit_get(p))hi = m;
else lo = m + 1;
}
if(lo == 0){
return 0;
}
int p = x>>(2 * (lo-1));
int ld = p & 3;
if(ld == 0)return -1;
if(ld == 3)return 1;
if(ld == 1){
if(bit_get(4 * (x>>(2 * lo)) + d[lo-1]))return 1;
else return -1;
}
if(ld == 2){
if(bit_get(4 * (x>>(2 * lo)) + 3 + d[lo-1]))return -1;
else return 1;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1387 ms |
96036 KB |
Output is correct - maxAccess = 10, score = 100 |