# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1082223 | raphael_heuchl | Boxes with souvenirs (IOI15_boxes) | C++14 | 1 ms | 448 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 <vector>
#include <algorithm>
#include <map>
#include <iostream>
#define INF 1'000'000'000'000'000'000
#define MIN(a, b) ((a) < (b) ? (a) : (b))
long long delivery(int N, int K, int L, int p[])
{
long long best = INF;
for (int i = 0; i < K; ++i)
{
long long sum = 0;
long long pos = i;
sum += p[i] + MIN(p[i], L - p[i]);
while (pos < N-1)
sum += MIN(L - 2*p[pos+1], 0) + p[pos=MIN(pos+K, N-1)] + MIN(p[pos], L - p[pos]);
best = MIN(best, sum);
}
return best;
}
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... |