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"
using namespace std;
const long long INF = 1e18;
long long findGap(int t, int n)
{
long long x,y;
MinMax(0,INF,&x,&y);
long long ans = (y-x)/(n-1);
long long num = x;
long long last = x;
while(num != y){
long long tmp1,tmp2;
MinMax(num+1,num+ans,&tmp1,&tmp2);
if(tmp1 == -1){
num += ans;
}
else{
ans = max(ans,tmp1 - last);
num = tmp2;
last = tmp2;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |