# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1034061 | Zicrus | Boxes with souvenirs (IOI15_boxes) | C++17 | 1 ms | 348 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;
typedef long long ll;
ll delivery(int n, int k, int l, int p11[]) {
vector<ll> p(n);
for (int i = 0; i < n; i++) p[i] = p11[i];
ll fR = lower_bound(p.begin(), p.end(), l/2) - p.begin();
if (fR == 0) return 2*(l-p[fR]);
ll fL = fR-1;
if (fL == n-1) return 2*p[fL];
return p[fL] + l-p[fR] + min(p[fR]-p[fL], l-(p[fR]-p[fL]));
}
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... |