제출 #262090

#제출 시각아이디문제언어결과실행 시간메모리
262090defineGap (APIO16_gap)C++11
0 / 100
58 ms1152 KiB
#include "gap.h" #define ll long long template<class T> inline bool chmax(T &a,T b){ if(a<b){a=b;return true;} return false; } ll solve1(int N){ ll ans=0; ll l=0,r=1e18; for(int i=0;i<(N+1)/2;i++){ ll mn,mx; MinMax(l+1,r-1,&mn,&mx); if(i){ chmax(ans,mn-l); chmax(ans,r-mx); } l=mn; r=mx; } if(N%2==0)chmax(ans,r-l); return ans; } ll findGap(int T, int N){ return solve1(N); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...