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