Submission #752473

#TimeUsernameProblemLanguageResultExecution timeMemory
752473phoebeBoxes with souvenirs (IOI15_boxes)C++17
10 / 100
1 ms308 KiB
#include <bits/stdc++.h> #include "boxes.h" using namespace std; #define ll long long ll delivery(int n, int k, int l, int p[]){ ll cw[n], ccw[n]; cw[0] = p[0] * 2; ccw[n - 1] = (l - p[n - 1]) * 2; for (int i = 1; i < n; i++){ cw[i] = cw[max(0, i - k)] + p[i] + min(p[i], l - p[i]); } for (int i = n - 2; i >= 0; i--){ ccw[i] = ccw[min(n - 1, i + k)] + (l - p[i]) + min(p[i], l - p[i]); } ll re = min(cw[n - 1], ccw[0]); for (int i = 1; i < n; i++){ re = min(re, cw[i - 1] + ccw[i]); } return re; }
#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...