# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
76380 | 2018-09-13T08:55:27 Z | vex | Gap (APIO16_gap) | C++14 | 0 ms | 0 KB |
#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,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; } }