Submission #712698

#TimeUsernameProblemLanguageResultExecution timeMemory
712698onepunchac168Gap (APIO16_gap)C++14
30 / 100
44 ms1864 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; long long a[100005]; long long findGap(int t, int n) { long long gmin=0; long long gmax=1e18; for (int i=1;i<=n/2;i++) { long long aa,bb; MinMax(gmin,gmax,&aa,&bb); a[i]=aa; a[n-i+1]=bb; gmin=aa+1; gmax=bb-1; } if (n%2==1) { long long aa,bb; MinMax(gmin,gmax,&aa,&bb); gmin=aa; gmax=bb; a[n/2+1]=gmin; } long long res=0; for (int i=2;i<=n;i++) { res=max(res,a[i]-a[i-1]); } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...