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;
const int MAXN = 555555;
typedef long long ll;
ll a[MAXN];
long long findGap(int SUBTASK, int n){
ll mn = 0, mx = 1e18;
for (int i = 1; i <= (n + 1) / 2; i++){
MinMax(mn, mx, &a[i], &a[n - i + 1]);
mn = a[i] + 1;
mx = a[n - i + 1] - 1;
}
ll ans = 0;
for (int i = 1; i < n; i++){
ans = max(ans, a[i + 1] - a[i]);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |