# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
976816 | Amaarsaa | Boxes with souvenirs (IOI15_boxes) | C++14 | 566 ms | 293768 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "boxes.h"
using namespace std;
using ll = long long ;
ll delivery(int N,int K, int L, int p[]) {
ll ans, cnt_ard, cnt_urd, res, i;
ll Pre[N + 2], Suf[N + 2];
Pre[0] = Suf[0] = 0;
for (i = 1; i <= N; i ++) {
Suf[i] = Suf[max(i - K, 0ll)] + p[i- 1] * 2;
Pre[i] = Pre[max(i - K, 0ll)] + (L - p[N - i]) * 2;
}
ans = 1e18;
for (i = 0; i <= N; i ++) {
ans = min(ans, Pre[i] + min(Suf[N - i], Suf[max(N - i - K, 0ll)] + L));
}
return ans ;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |