Submission #364894

#TimeUsernameProblemLanguageResultExecution timeMemory
364894dennisstarBoxes with souvenirs (IOI15_boxes)C++17
0 / 100
1 ms364 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; using ll = long long; const ll MX = 1e7 + 5; ll D[MX], E[MX]; ll delivery(int N, int K, int L, int *P) { for (int i=1; i<=N; i++) D[i]=(i>K?D[i-K]:0)+P[i]+min(P[i], L-P[i]); for (int i=N; i>=1; i--) E[i]=(i<=N-K?E[i+K]:0)+(L-P[i])+min(P[i], L-P[i]); ll A=1e18; for (int i=0; i<=N; i++) A=min(A, D[i]+E[i+1]); return A; }
#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...