Submission #338969

#TimeUsernameProblemLanguageResultExecution timeMemory
338969nandonathanielcmp (balkan11_cmp)C++14
73 / 100
1830 ms82668 KiB
#include "cmp.h" #include "bits/stdc++.h" using namespace std; void remember(int n) { for(int i=5;i>=0;i--){ int x=n & (1<<(2*i+1)); int y=n & (1<<(2*i)); if(x==0){ if(y==0){ bit_set(i*4+1); } else{ bit_set(i*4+2); } } else{ if(y==0){ bit_set(i*4+3); } else{ bit_set(i*4+4); } } } } int compare(int a) { for(int i=5;i>=0;i--){ int x=a & (1<<(2*i+1)); int y=a & (1<<(2*i)); if(x==0){ if(y==0){ if(!bit_get(i*4+1))return -1; } else{ if(!bit_get(i*4+2)){ if(bit_get(i*4+1))return 1; else return -1; } } } else{ if(y==0){ if(!bit_get(i*4+3)){ if(bit_get(i*4+4))return -1; else return 1; } } else{ if(!bit_get(i*4+4))return 1; } } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...