제출 #108023

#제출 시각아이디문제언어결과실행 시간메모리
108023luciocfGap (APIO16_gap)C++14
30 / 100
70 ms2008 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; const int maxn = 1e5+10; const long long maxv = 1e18; typedef long long ll; ll a[maxn]; long long findGap(int T, int N) { if (T == 1) { ll mn, mx; MinMax(0, maxv, &mn, &mx); int l = 1, r = N; a[1] = mn, a[N] = mx; while (true) { if (r-l <= 1) break; MinMax(a[l]+1, a[r]-1, &mn, &mx); a[++l] = mn, a[--r] = mx; } ll ans = 0; for (int i = 1; i < N; i++) ans = max(ans, a[i+1]-a[i]); return ans; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...