# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
405235 | enerelt14 | 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<bits/stdc++.h>
using namespace std;
long long findGap(int T,int N){
long long l[N], r[N], res=0;
MinMax(0, 1e18, &l[1], &r[1]);
for (int i=2;i<=(N+1)/2;i++){
MinMax(l[i-1], r[i-1], &l[i], &r[i]);
res=max(res, max(l[i]-l[i-1], r[i-1]-r[i]));
}
return res;
}