제출 #742641

#제출 시각아이디문제언어결과실행 시간메모리
742641AndrijaMGap (APIO16_gap)C++14
0 / 100
45 ms1160 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; 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...