Submission #742620

#TimeUsernameProblemLanguageResultExecution timeMemory
742620AndrijaMGap (APIO16_gap)C++14
0 / 100
54 ms1200 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; long long findGap(int T, int N){ long long l=0; long long r=1e18; long long mn,mx; long long ans=0; long long a=0,b=0; while(l<=r) { MinMax(l,r,&mn,&mx); if(mn==-1 || mx==-1)break; ans=max(ans, abs(a-mn)); ans=max(ans, abs(b-mx)); a=mn; l=mn+1; b=mx; r=mx-1; } ans=max(ans, abs(a-b)); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...