This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll findGap(int T, int N) {
ll ans = 0;
ll mn = 0;
ll mx = 1'000'000'000'000'000'000LL;
vector<ll> a(N);
for (int i = 0; i < (N + 1) / 2; ++i) {
MinMax(mn, mx, &a[i], &a[N - 1 - i]);
mn = a[i] + 1;
mx = a[N - 1 - i] - 1;
}
for (int i = 1; i < N; ++i) {
ans = max(ans, a[i] - a[i - 1]);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |