이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define N_MAX 100002
using namespace std;
const ll INF = 1000000000000000000;
void MinMax(long long s, long long t, long long *mn, long long *mx);
ll a[N_MAX];
ll mi, mx;
ll findGap (int t, int n)
{
a[0] = -1;
a[n + 1] = INF + 1;
int x = 1, y = n;
while(x <= y)
{
MinMax(a[x - 1] + 1, a[y + 1] - 1, &mi, &mx);
a[x] = mi;
a[y] = mx;
x++;
y--;
}
ll ans = 0;
for(int i = 2; i <= n; i++)
ans = max(ans, a[i] - a[i - 1]);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |