# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
420099 | temurbek_khujaev | Boxes with souvenirs (IOI15_boxes) | C++17 | 531 ms | 70500 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>
using namespace std;
long long delivery(int N, int K, int L, int p[]) {
long long ans = 1ll * N * L;
int mid = lower_bound(p, p + N, (L + 1) / 2) - p;
for (int i = max(-1, mid - K - 2); i < min(N, mid + K + 2); i++) {
long long cur = 0;
int x = i;
int y = i + 1;
while (x >= 0) {
cur += min(L, p[x] * 2);
x -= K;
}
while (y < N) {
cur += min(L, (L - p[y]) * 2);
y += K;
}
ans = min(ans, cur);
}
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... |