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;
#define ll long long
long long findGap(int T, int n)
{
ll l=0,r=0;
MinMax(0ll,(ll)(1e18),&l,&r);
ll res=(r-l)/(n-1);
ll ans=(r-l)/(n-1);
while(l<r){
ll a=0,b=0;
MinMax(l+1,l+res+1,&a,&b);
if(b==-1){
res+=res;
}
else{
ans=max(ans,a-l);
l=b;
res=ans;
}
}
return ans;
}
/*
g++ gap.cpp grader.cpp ; .\a.exe
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |