Submission #732990

#TimeUsernameProblemLanguageResultExecution timeMemory
732990SanguineChameleonGap (APIO16_gap)C++17
30 / 100
41 ms1852 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; const int maxN = 1e5 + 20; long long a[maxN]; long long findGap(int T, int N) { if (T == 1) { long long mi = 0; long long mx = 1e18L; int lt = 1; int rt = N; while (lt <= rt) { MinMax(mi, mx, &mi, &mx); a[lt] = mi; a[rt] = mx; mi++; mx--; lt++; rt--; } long long res = 0; for (int i = 1; i <= N - 1; i++) { res = max(res, a[i + 1] - a[i]); } return res; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...