# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
848972 | abcvuitunggio | cmp (balkan11_cmp) | C++17 | 1139 ms | 106476 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 num[4]={0,8,72,584};
void remember(int n){
for (int i=0;i<4;i++)
bit_set((n>>(i*3))+num[3-i]+1);
}
int compare(int b) {
int l=0,r=3,kq=0;
while (l<=r){
int mid=(l+r)>>1;
if (bit_get((b>>(9-mid*3))+num[mid]+1))
l=kq=mid+1;
else
r=mid-1;
}
if (kq==4)
return 0;
b>>=(9-kq*3);
if (b%8<4){
for (int i=0;i<b%8;i++)
if (bit_get(b/8*8+i+num[kq]+1))
return 1;
return -1;
}
for (int i=b%8+1;i<8;i++)
if (bit_get(b/8*8+i+num[kq]+1))
return -1;
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |