Submission #742645

#TimeUsernameProblemLanguageResultExecution timeMemory
742645AndrijaMGap (APIO16_gap)C++14
30 / 100
44 ms1188 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; MinMax(l,r, &mn, &mx); a=mn; l=mn+1; b=mx; r=mx-1; N-=2; while(l<=r) { if(N<=0)break; MinMax(l,r, &mn, &mx); ans=max(ans, mn-a); ans=max(ans, b-mx); a=mn; l=mn+1; b=mx; r=mx-1; N-=2; } ans=max(ans, b-a); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...