이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
long long findGap(int T, int N)
{
ll inf = 1e18;
ll lf = 0, rf = 1e18, mn, mx;
set < ll > st;
int nn = 0;
lf = 0;
rf = inf;
while(nn < N)
{
MinMax(lf, rf, &mn, &mx);
st.insert(mn);
st.insert(mx);
lf = mn + 1;
rf = mx - 1;
nn += 2;
}
ll ans = 0;
ll last = -1;
for (auto it : st)
{
if (last != -1)
ans = max(ans, it - last);
last = it;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |