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, r;
MinMax(1, 1e18, &l, &r);
long long lim = (r - l) / N;
long long ans = lim, curr = l;
while(curr < r - 1)
{
long long a, b;
MinMax(curr + 1, min(curr + lim, r - 1), &a, &b);
if (a == -1) curr += lim;
else
{
ans = max(ans, a - l);
l = b;
curr += lim;
}
}
ans = max(ans, r - l);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |