Submission #370653

#TimeUsernameProblemLanguageResultExecution timeMemory
370653Bill_00Gap (APIO16_gap)C++14
30 / 100
54 ms2156 KiB
#include "gap.h" #include <bits/stdc++.h> #define N 100005 typedef long long ll; using namespace std; ll a[N],mn,mx; long long findGap(int T, int n) { ll m1=0,m2=1e18,ans=0; if(T==1){ for(int i=1;i<=(n+1)/2;i++){ MinMax(m1,m2,&mn,&mx); a[i]=mn; a[n+1-i]=mx; m1=mn+1; m2=mx-1; } for(int i=1;i<n;i++){ ans=max(ans,a[i+1]-a[i]); } return ans; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...