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>
const long long INF = 1e18 + 6;
using namespace std;
long long a[100005];
long long findGap(int T, int N)
{
if(T == 1){
int l = 0;
int r = N - 1;
long long mn = 0, mx = INF;
long long h,h1;
while(l <= r){
MinMax(mn, mx, &h, &h1);
a[l] = h;
a[r] = h1;
l++;
r--;
mn = h + 1;
mx = h1 - 1;
}
long long ans = 0;
for(int i = 1; i < N; i++){
ans = max(ans,a[i] - a[i - 1]);
}
return ans;
}
else{
return 7;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |