Submission #16529

#TimeUsernameProblemLanguageResultExecution timeMemory
16529gs13068Boxes with souvenirs (IOI15_boxes)C++98
0 / 100
2 ms380 KiB
#include <algorithm> long long L[11111111]; long long R[11111111]; long long delivery(int n,int k,int l,int a[]) { long long r=1e18; int i; for(i=1;i<=n;i++) { L[i]=std::min(a[i-1]<<1,l); if(i>k)L[i]+=L[i-k]; } for(i=n-1;i>=0;i--) { R[i]=std::min((l-a[i])<<1,l); if(i+k<n)R[i]+=R[i+k]; } for(i=0;i<n;i++)r=std::min(r,L[i]+R[i+1]); return r; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...