Submission #720827

#TimeUsernameProblemLanguageResultExecution timeMemory
720827JoshcGap (APIO16_gap)C++11
0 / 100
43 ms1872 KiB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;

using ll = long long;

ll findGap(int T, int N) {
    vector<ll> a(N);
    int l = 0, r = N-1;
    ll p = -1, q = (1e18)+1;
    while (l <= r) {
        MinMax(p+1, q-1, &p, &q);
        a[l++] = p;
        a[r--] = q;
    }
    ll res = 0;
    for (int i=1; i<N; i++) res = max(res, a[i] - a[i-1]);
    return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...