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 <cstdio>
#include <algorithm>
using namespace std;
long long findGap(int T, int N)
{
long long arr[N];
int s=0,e=N-1;
long long a=0,b=1000000000000000000,sm,lm;
while (e-s>0){
MinMax(a,b,&sm,&lm);
arr[s]=sm,arr[e]=lm;
a=sm+1,b=lm-1;
s++,e--;
}
if (e==s){
MinMax(a,b,&sm,&lm);
arr[e]=sm;
}
long long maximal=0;
for (int x=1;x<N;x++){
maximal=max(maximal,arr[x]-arr[x-1]);
}
return maximal;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |