# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
413005 | jjj | Gap (APIO16_gap) | C++14 | 44 ms | 1924 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"
#define MAXN 100010
long long a[MAXN];
long long findGap(int T, int N)
{
long long mn = 0, mx = 0;
MinMax(0, 1e18 + 1, &mn, &mx);
a[0] = mn;
a[N - 1] = mx;
int l = 1, r = N - 2;
while(l <= r)
{
MinMax(a[l - 1], a[r + 1], &mn, &mx);
a[l] = mn;
a[r] = mx;
l++;
r--;
}
long long x = 0;
for(int i = 0; i < N - 1; i++)
if(a[i + 1] - a[i] > x) x = a[i + 1] - a[i];
return x;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |