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;
long long findGap(int T, int N){
long long l=0;
long long r=1e18;
long long mn,mx;
long long ans=0;
long long a=0,b=0;
MinMax(l,r,&mn,&mx);
a=mn;
l=mn+1;
b=mx;
r=mx-1;
while(l<=r)
{
MinMax(l,r,&mn,&mx);
if(mn==-1 || mx==-1)break;
ans=max(ans, abs(a-mn));
ans=max(ans, abs(b-mx));
a=mn;
l=mn+1;
b=mx;
r=mx-1;
}
ans=max(ans, abs(a-b));
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |