# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569024 | BadPenalty | 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)
{
vector<long long>ll(N+10);
long long a = 0,b = 1e18;
for(int i = 1;i<=N;i++)
{
if(ll[i])break;
MinMax(a,b,&a,&b);
ll[i] = a,ll[N-i+1] = b;
a++,b--;
}
long long ans = 0;
for(int i = 2;i<=N;i++)
{
ans = max(ans,ll[i]-ll[i-1]);
}
return ans;
}