Submission #90418

# Submission time Handle Problem Language Result Execution time Memory
90418 2018-12-21T15:22:42 Z igzi cmp (balkan11_cmp) C++17
100 / 100
1789 ms 82584 KB
#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
1 Correct 1789 ms 82584 KB Output is correct - maxAccess = 10, score = 100