제출 #1084431

#제출 시각아이디문제언어결과실행 시간메모리
1084431MMihalevGap (APIO16_gap)C++17
30 / 100
34 ms1240 KiB
#include<iostream> #include<algorithm> #include "gap.h" using namespace std; long long findGap(int T, int N) { if(T==2)return 69LL; long long l=-1,r=1000000000000000001; long long mn,mx; int rem=N; long long ans=1; while(rem>0) { MinMax(l+1,r-1,&mn,&mx); if(rem==2)ans=max(ans,mx-mn); if(l!=-1) { ans=max(ans,mn-l); ans=max(ans,r-mx); } if(mn!=mx)rem-=2; else rem--; l=mn; r=mx; } if(T==1)return ans; else return 69; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...