이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 555555;
typedef long long ll;
ll a[MAXN];
long long findGap(int SUBTASK, int n){
a[0] = -1;
for (int i = 1; i <= n; i++){
ll l = a[i - 1] + 1, r = 1e18;
while (l <= r){
ll m = (l + r) >> 1;
ll mn, mx;
MinMax(l, m, &mn, &mx);
if (mx != -1){
a[i] = m;
r = m - 1;
} else l = m + 1;
}
}
ll ans = 0;
for (int i = 1; i < n; i++){
ans = max(ans, a[i + 1] - a[i]);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |