# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
520715 | peti1234 | Boxes with souvenirs (IOI15_boxes) | C++17 | 1 ms | 296 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>
using namespace std;
long long delivery(int n, int k, int l, int a[]) {
// 1
if (k==1) {
long long valasz=0;
for (int i=0; i<n; i++) {
valasz+=2*min(a[i], l-a[i]);
}
return valasz;
}
// 2
if (k==2) {
int bal=0, jobb=l;
for (int i=0; i<n; i++) {
if (2*a[i]<l) {
bal=max(bal, a[i]);
} else {
jobb=min(jobb, a[i]);
}
}
return min(l, 2*bal+2*(l-jobb));
}
}
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... |