# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
744209 | b00norp | Gap (APIO16_gap) | C++14 | 0 ms | 0 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;
long long findGap(int T, int N)
{
if(T == 1)
{
long long mn = 0, mx = 1e18;
vector<long long> a(N);
int l = 0, r = N - 1;
while(l <= r)
{
MinMax(mn, mx, mn, mx);
a[l++] = mn;
a[r--] = mx;
}
long long diff = 0;
for(int i = 1; i < N; i++)
{
diff = max(diff, a[i] - a[i - 1]);
}
return diff;
}
return 0;
}