#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
long long findGap(int t, int n) {
ll first, last, l = 0, ans = 0;
MinMax(l, 1e18, &first, &last);
ll dif = last - first;
ans = dif; l = first;
for (ll i = l + 1; i < last; i += dif + 1) {
ll mn, mx;
MinMax(i, min(i + dif, last - 1), &mn, &mx);
if (mn == -1) continue;
ans = max(ans, mn - l);
l = mx;
}
ans = max(ans, last - l);
return ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |