이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "gap.h"
#define ll long long
using namespace std;
#define alll(x) x.begin(), x.end()
long long findGap(int T, int n)
{
vector<ll> a;
ll l = 1, r = 1e18;
ll mn, mx;
for (int i = 0; i < (n+1)/2; i++) {
MinMax(l, r, &mn, &mx);
a.push_back(mn);
a.push_back(mx);
l = mn+1, r = mx-1;
}
sort(a.begin(), a.end());
ll ans = 0;
for (int i = 0; i < n-1; 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... |