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;
typedef long long ll;
ll findGap(int asdposjidfjioafg, int n)
{
ll f = 0, l = 0;
MinMax(0LL, 1LL * 1e18, &f, &l);
ll last = l;
ll add = (l - f)/(n - 1);
ll lim = (l - f - n + 1);
ll res = 0;
while (f < last)
{
ll lx, rx;
lx = f;
rx = l;
MinMax(f + 1, f + add, &lx, &rx);
if (lx == -1)
{
add *= 2;
}
else
{
res = max(res, lx - f);
f = rx;
}
}
return res;
}
Compilation message (stderr)
gap.cpp: In function 'll findGap(int, int)':
gap.cpp:14:8: warning: unused variable 'lim' [-Wunused-variable]
14 | ll lim = (l - f - n + 1);
| ^~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |