# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
420078 | maximath_1 | cmp (balkan11_cmp) | C++11 | 2068 ms | 102172 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |