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<bits/stdc++.h>
#define ll long long
using namespace std;
void MinMax(long long s, long long t, long long *mn, long long *mx);
long long findGap(int T, int N){
ll arr[N];
ll l = 0, r = LLONG_MAX;
for(int i = 0, j = N-1; i <= j; i++, j--){
MinMax(l, r, &arr[i], &arr[j]);
l = arr[i] + 1, r = arr[j] - 1;
}
ll ans = 0;
for(int i = 1; i < N; i++){
ans = max(ans, arr[i] - arr[i-1]);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |