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<bits/stdc++.h>
#include "gap.h"
#define MAXN 600007
using namespace std;
const long long inf=1e18;
long long *l,*r,*ll,*rr;
long long d,ans;
long long findGap(int T, int N){
l=new long long();
r=new long long();
MinMax(1, inf, l,r);
if(N==2)return *r-*l;
d=ans=1;
while(*l!=*r){
while(true){
ll=new long long();
rr=new long long();
MinMax((*l)+1,(*l)+d,ll,rr);
if((*ll)!=-1)break;
d*=2;
}
ans=max(ans,*ll-*l);
d=ans;
l=rr;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |