Submission #90418

#TimeUsernameProblemLanguageResultExecution timeMemory
90418igzicmp (balkan11_cmp)C++17
100 / 100
1789 ms82584 KiB
#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 timeMemoryGrader output
Fetching results...