# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90418 | igzi | cmp (balkan11_cmp) | C++17 | 1789 ms | 82584 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 <bits/stdc++.h>
#include "cmp.h"
using namespace std;
int a[5]={6,8,10,12};
int b[5]={1,6,48,480};
int pos[5]={1,7,15,25};
void remember(int val){
int i,tmp;
for(i=0;i<4;i++){
tmp=val%a[i];
bit_set(pos[i]+tmp);
val/=a[i];
}
}
int compare(int val){
int i,tmp,j;
for(i=3;i>=0;i--){
tmp=val/b[i];
val%=b[i];
if(bit_get(pos[i]+tmp)) continue;
if(tmp+1<=a[i]/2){
for(j=0;j<tmp;j++){
if(bit_get(pos[i]+j)) return 1;
}
return -1;
}
else{
for(j=tmp+1;j<a[i];j++){
if(bit_get(pos[i]+j)) return -1;
}
return 1;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |