# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
76382 | vex | Gap (APIO16_gap) | C++14 | 59 ms | 39412 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 <bits/stdc++.h>
#include<gap.h>
#define maxn 100005
#define INF 1e18 + 1000
using namespace std;
int n;
long long a[maxn];
long long findGap(int t,int n)
{
if(t==1)
{
int br=1;
long long mn,mx;
a[0]=0;
a[n+1]=INF;
while(br<=(n+1)/2)
{
MinMax(a[br-1]+1,a[n+2-br]-1,&mn,&mx);
a[br]=mn;
a[n+1-br]=mx;
br++;
}
long long sol=0;
for(int i=1;i<n;i++)
{
if(a[i+1]-a[i]>sol)sol=a[i+1]-a[i];
}
return sol;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |