Submission #1092485

#TimeUsernameProblemLanguageResultExecution timeMemory
1092485alexander707070Gap (APIO16_gap)C++14
34.63 / 100
37 ms7376 KiB
#include<bits/stdc++.h> #include "gap.h" #define MAXN 600007 using namespace std; const long long inf=1e18; long long *l,*r,*ll,*rr; long long d,ans; long long findGap(int T, int N){ l=new long long(); r=new long long(); MinMax(1, inf, l,r); if(N==2)return *r-*l; d=ans=1; while(*l!=*r){ while(true){ ll=new long long(); rr=new long long(); MinMax((*l)+1,(*l)+d,ll,rr); if((*ll)!=-1)break; d*=2; } ans=max(ans,*ll-*l); d=ans; l=rr; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...