# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
743749 | boyliguanhan | cmp (balkan11_cmp) | C++17 | 1278 ms | 96024 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"
int pos[6]{1, 4097, 5121, 5377, 5441, 5457};
void remember(int n) {
for(int i = 0; i < 6; i++) bit_set(pos[i]+(n>>i*2));
}
int compare(int b) {
int l = 0, r = 6;
while(l < r) {
int mid = l+r>>1;
if(bit_get(pos[mid]+(b>>mid*2)))r= mid;
else l = mid+1;
}
if(!l) return 0;
int d = b>>2*l-2&3;
if(d>1) if(bit_get((((b>>l*2)<<2)+3)+pos[l-1])) return -1; else return 1;
else if(bit_get(((b>>l*2)<<2)+pos[l-1])) return 1; else return -1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |