제출 #553213

#제출 시각아이디문제언어결과실행 시간메모리
553213GurbanGap (APIO16_gap)C++17
12.65 / 100
52 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 = 0; while(now < sag){ ll nwa,nwb; // MinMax(now,now + ans + 1,&nwa,&nwb); for(ll i = 0;i < 61;i++){ MinMax(now+1,now + ans + (1ll << i),&nwa,&nwb); if(nwa != -1){ ans = max(ans,nwa - now); now = nwb; break; } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...