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 lli long long int
using namespace std;
int n;
long long findGap(int T, int N)
{
n = N;
lli nl, nr;
MinMax(0, 1e18, &nl, &nr);
lli ans = 1;
while(nl < nr)
{
lli l, r;
MinMax(nl + 1, nl + ans * 2 - 1, &l, &r);
if(l == -1) ans = ans * 2;
else ans = max(ans, l - nl), nl = r;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |