이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "gap.h"
#ifdef MINA
#include "grader.cpp"
#endif
using namespace std;
#define ll long long
const ll inf = 1e18;
ll findGap(int t, int n) {
ll s, e;
MinMax(0, inf, &s, &e);
if (n == 2) {
return e - s;
}
ll len = e - s;
ll b = (len - 1) / (n - 1);
ll lst = s, mx = b;
ll en = e;
for (ll i = s + 1; i <= en - 1; i += b) {
MinMax(i, min(i + b - 1, en - 1), &s, &e);
if (s == -1) continue;
if (s != -1) {
mx = max(mx, s - lst);
}
b = mx;
lst = e;
}
mx = max(mx, en - lst);
return mx;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |