이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |