This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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... |