제출 #106762

#제출 시각아이디문제언어결과실행 시간메모리
106762brcodeGap (APIO16_gap)C++14
30 / 100
69 ms3732 KiB
#include <iostream> #include "gap.h" using namespace std; const int MAXN = 1e6+5; long long arr[MAXN]; long long findGap(int T,int N){ long long a = 1; long long b = 1e18; long long l = 0; long long r = N-1; long long mn,mx; long long total = 0; while(total<N){ MinMax(a, b, &mn, &mx); arr[l] = mn; arr[r] = mx; l++; r--; total+=2; a = mn+1; b = mx-1; } long long diff = 0; for(long long i=0;i<N-1;i++){ diff = max(diff,arr[i+1]-arr[i]); } return diff; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...