제출 #162068

#제출 시각아이디문제언어결과실행 시간메모리
162068impriGap (APIO16_gap)C++14
0 / 100
59 ms1932 KiB
#include<bits/stdc++.h> #include"gap.h" using namespace std; long long res[100001]; long long findGap(int T,int N){ long long mi,ma; long long *mn=&mi; long long *mx=&ma; MinMax(1,1000000000000000000LL,mn,mx); res[1]=mi; res[N]=ma; int curmi=2; int curma=N-1; while(1){ if(curmi>curma)break; MinMax(res[curmi-1]+1,res[curma+1]-1,mn,mx); res[curmi]=mi; res[curma]=ma; curmi++; curma--; } long long r=1000000000000000000LL; for(int i=1;i<N;i++){ r=min(r,res[i+1]-res[i]); } return r; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...