Submission #90416

# Submission time Handle Problem Language Result Execution time Memory
90416 2018-12-21T15:15:09 Z igzi cmp (balkan11_cmp) C++17
0 / 100
1097 ms 82644 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<pos[i]+a[i];j++){
if(bit_get(pos[i]+j)) return -1;
}
return 1; 
}
}
return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1097 ms 82644 KB ZERO POINTS: For a=3040 and b=3318, correct answer is 1, got -1