Submission #554236

#TimeUsernameProblemLanguageResultExecution timeMemory
554236GurbanGap (APIO16_gap)C++17
0 / 100
34 ms1104 KiB
#include "bits/stdc++.h" #include "gap.h" using namespace std; using ll = long long; long long findGap(int T, int N) { ll cep,sag; MinMax(1,(ll)1e18,&cep,&sag); assert(cep != -1 && sag != -1); ll now = cep,ans = 1; while(now < sag){ ll nwa,nwb; while(1){ MinMax(now + 1,now + ans * 2,&nwa,&nwb); if(nwa != -1){ ans = max(nwa - now,ans); now = nwb; break; } ans *= 2; ans++; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...