이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
long long findGap(int T, int N)
{
long long l, r;
MinMax(1, 1e18, &l, &r);
long long lim = (r - l + N - 1) / N;
long long ans = lim, curr = l;
while(curr < r - 1)
{
long long a, b;
MinMax(curr + 1, min(curr + lim, r - 1), &a, &b);
if (a == -1) curr += lim;
else
{
ans = max(ans, a - l);
l = b;
curr += lim;
}
}
ans = max(ans, r - l);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |