Submission #17515

#TimeUsernameProblemLanguageResultExecution timeMemory
17515gs14004cmp (balkan11_cmp)C++14
28 / 100
8240 ms104984 KiB
#include "cmp.h" #include <vector> #include <algorithm> using namespace std; void remember(int n) { n += 4096; while(n){ bit_set(n); n >>= 1; } } int compare(int b) { b += 4096; if(bit_get(b)) return 0; vector<int> v; while(b){ v.push_back(b); b >>= 1; } reverse(v.begin(), v.end()); int s = 0, e = v.size() - 1; while(s != e){ int m = (s+e)/2; if(!bit_get(v[m])) e = m; else s = m+1; } if(v[s]%2) return 1; return -1; }
#Verdict Execution timeMemoryGrader output
Fetching results...