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;
//void MinMax(s,t,&mn,&mx)
long long findGap(int TT, int n){
while(TT--){
//long long s,t,&mn,&mx;
vector<long long>dn(n);
MinMax(0,1000000000000000000LL,&dn[0],&dn[n-1]);
for(int i=1;i<n/2;i++){
MinMax(dn[i-1],dn[n-i],&dn[i],&dn[n-i-1]);
}
if(n%2==1){
MinMax(dn[n/2-1],dn[n/2+1],&dn[n/2],&dn[n/2]);
}
long long mn=0LL;
for(int i=0;i<n-1;i++){
mn=max(mn,dn[i+1]-dn[i]);
}
return mn;
}
}
Compilation message (stderr)
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
24 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |