Submission #565373

#TimeUsernameProblemLanguageResultExecution timeMemory
565373n0sk1llBoxes with souvenirs (IOI15_boxes)C++14
10 / 100
1 ms340 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; long long int typedef li; li dp[10000007]; li dpr[10000007]; long long delivery(int n, int k, int L, int p[]) { for (int i=1;i<=n;i++) dp[i]=dp[max(0,i-k)]+2*p[i-1]; for (int i=n;i>=1;i--) dpr[i]=dpr[min(n+1,i+k)]+2*(L-p[i-1]); li ans=1e18; for (int i=1;i<=n+1;i++) ans=min(ans,dp[i-1]+dpr[i]); for (int i=k;i<=n+1;i++) ans=min(ans,dp[i-k]+dpr[i]+L); return ans; }
#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...