Submission #364895

#TimeUsernameProblemLanguageResultExecution timeMemory
364895dennisstarBoxes with souvenirs (IOI15_boxes)C++17
100 / 100
571 ms256236 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-1]+min(P[i-1], L-P[i-1]); for (int i=N; i>=1; i--) E[i]=(i<=N-K?E[i+K]:0)+(L-P[i-1])+min(P[i-1], L-P[i-1]); 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...