Submission #94518

#TimeUsernameProblemLanguageResultExecution timeMemory
94518hugo_pmGap (APIO16_gap)C++14
0 / 100
54 ms3448 KiB
#include "gap.h" #include <vector> #include <iostream> using namespace std; typedef long long ll; vector<int> a; long long findGap(int t, int n) { a.resize(n); ll x = 0, y = (ll)(1e18); int d = 0, f = n-1; while (d <= f) { MinMax(x, y, &x, &y); a[d] = x; a[f] = y; ++x; ++d; --y; --f; } int r = 0; for (int i = 0; i < (n-1); ++i) { r = max(r, a[i+1] - a[i]); } return r; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...