# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
519586 | silverfish | Boxes with souvenirs (IOI15_boxes) | C++17 | 2 ms | 216 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;
const int N = 1000007;
ll dp[N], p[N];
long long delivery(int n, int k, int L, int p[]) {
ll l = L;
fill(dp, dp+n, 1LL*n*l);
dp[0] = 0;
for(int i = 1; i <= n; ++i){
ll mn = min(l, 2LL*p[i-1]);
for(int j = i; j > max(i-k, 0); --j){
ll cmn = min(mn, 2LL*(l-p[j-1]));
dp[i] = min(dp[i], dp[j-1] + cmn);
}
}
return dp[n];
}
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... |