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