Submission #344039

#TimeUsernameProblemLanguageResultExecution timeMemory
344039milleniumEeeeGap (APIO16_gap)C++17
0 / 100
35 ms1900 KiB
#include "gap.h" //#include "grader.cpp" #include <bits/stdc++.h> #define ll long long using namespace std; //MinMax(long long s, long long t, long long *mn, long long *mx) const ll INF = (int)1e18; const int MAXN = (int)1e5 + 5; ll a[MAXN]; void f(bool ok) { if (!ok) { while (1); } } long long findGap(int type, int n) { ll mn = 0, mx = INF; int l = 1, r = n; while (l <= r) { MinMax(mn, mx, &mn, &mx); a[l] = mn; a[r] = mx; l++, r--; mn++, mx--; } ll ans = 0; for (int i = 1; i < n; i++) { ans = max(ans, a[i + 1] - a[i]); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...