Submission #16531

#TimeUsernameProblemLanguageResultExecution timeMemory
16531gs13068Boxes with souvenirs (IOI15_boxes)C++98
100 / 100
517 ms197052 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]); 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...