#include "cmp.h"
using namespace std;
int cnt = 0;
void remember(int n){
n += 4096;
for(; n > 1; n >>= 2, cnt ++)
bit_set(n);
}
int compare(int a){
a += 4096;
int lf = 0, rg = 6, gt = -1;
for(int md; lf <= rg;){
md = (lf + rg) >> 1;
if(md != 6 && !bit_get(a >> (md * 2))){
gt = a >> (md * 2);
lf = md + 1;
}else rg = md - 1;
}
if(gt == -1) return 0;
if(gt % 4 == 0) return -1;
else if(gt % 4 == 1) return bit_get(gt / 4 * 4) ? 1 : -1;
else if(gt % 4 == 2) return bit_get(gt / 4 * 4 + 3) ? -1 : 1;
else return 1;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2068 ms |
102172 KB |
Output is correct - maxAccess = 10, score = 100 |