Submission #712693

#TimeUsernameProblemLanguageResultExecution timeMemory
712693onepunchac168Gap (APIO16_gap)C++14
0 / 100
38 ms1956 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); gmin=aa; gmax=bb; a[i]=gmin; a[n-i+1]=gmax; } 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...