# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
218170 | SamAnd | Gap (APIO16_gap) | C++17 | 62 ms | 2040 KiB |
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 "gap.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n;
long long a[N];
long long findGap(int T, int N)
{
n = N;
a[0] = -1;
a[n + 1] = 1000000000000000001;
for (int l = 1, r = n; l <= r; ++l, --r)
{
long long minu, maxu;
MinMax(a[l - 1] + 1, a[r + 1] - 1, &minu, &maxu);
a[l] = minu;
a[r] = maxu;
}
long long ans = 0;
for (int i = 1; i < n; ++i)
ans = max(ans, a[i + 1] - a[i]);
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |