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 x, y;
MinMax(0, 1e18, &x, &y);
long long size = (y - x - 1) / (N - 1);
long long left = x + 1;
long long gap = 0, max_pos = x;
while (left < y) {
long long right = min(y - 1, left + size - 1);
long long Min, Max;
MinMax(left, right, &Min, &Max);
if (Min != -1) {
gap = max(gap, Min - max_pos);
max_pos = Max;
}
left += size;
}
return gap;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |