# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1190672 | Tsagana | Gap (APIO16_gap) | C++20 | 40 ms | 1224 KiB |
#include "gap.h"
#include "bits/stdc++.h"
using namespace std;
#define lnl long long
lnl ans, mn, mx, l, r;
lnl findGap(int T, int N) {
MinMax(0, LLONG_MAX, &l, &r);
lnl a = (r - l - 3 + N) / (N - 1);
lnl k = l;
while (l < r) {
MinMax(l, min(l + a, r), &mn, &mx);
if (~mn) {
ans = max(ans, mn - k);
k = mx;
}
l += a + 1;
}
return max(ans, r - k);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |