# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
95694 | ShaneOng | Gap (APIO16_gap) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
long long findGap(int T, int n){
long long ans=0ll;
//if(T==1){
long long l=0ll,r=1000000000000000000ll;
MinMax(l,r,&l,&r);
int temp=2;
for(int x=0;temp<n;x++){
long long newl=-1ll,newr=-1ll;
if(l+1ll<r-1ll)
MinMax(l+1ll,r-1ll,&newl,&newr);
if(newl!=-1ll){
ans=max(ans,max(l-newl,r-newr));
l=newl;
r=newr;
}
temp+=2;
}
//}
return ans;
}