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 <vector>
#include <algorithm>
long long a[(int)1e5 + 5];
long long findGap(int T, int N)
{
MinMax(0, 1LL << 60, a, a + N - 1);
for(int l = 1, r = N - 2; l <= r; ++l, --r) {
MinMax(a[l - 1] + 1, a[r + 1] - 1, a + l, a + r);
}
long long res = 0;
for(int i = 0; i + 1 < N; ++i) {
res = std::max(res, a[i + 1] - a[i]);
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |