# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
979609 | kilkuwu | Boxes with souvenirs (IOI15_boxes) | C++17 | 379 ms | 215868 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 "boxes.h"
#include <bits/stdc++.h>
#ifdef LOCAL
#include "template/debug.hpp"
#else
#define dbg(...) ;
#define timer(...) ;
#endif
long long delivery(int N, int K, int L, int p[]) {
int split = std::upper_bound(p, p + N, L / 2) - p;
std::vector<long long> dp(N);
for (int i = N - 1; i >= split; i--) {
if (i + K < N) {
dp[i] = dp[i + K] + (L - p[i]) * 2;
} else {
dp[i] = (L - p[i]) * 2;
}
}
for (int i = 0; i < split; i++) {
if (i - K >= 0) {
dp[i] = dp[i - K] + p[i] * 2;
} else {
dp[i] = p[i] * 2;
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... |