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;
using ll = long long;
ll findGap(int T, int N) {
ll x, y;
MinMax(0, (ll)1e18, &x, &y);
ll k = (y - x + N - 2) / (N - 1), ans = 0;
for (ll p = x; p != y; ) {
ll x2, y2, op = p;
do {
MinMax(p + 1, p + k, &x2, &y2);
p += k;
} while (x2 == -1);
ans = max(ans, x2 - op);
p = y2;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |