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;
#include "boxes.h"
long long delivery(int N, int K, int L, int p[]) {
long long o = 0;
if(L == 1) return 0;
if(K == 1) for(int i = 0; i < N; i++) o += 2*min(p[i], L-p[i]);
else {
int a = 0, b = 0;
for(int i = 0; i < N; i++) {
if(p[i] <= L<<1) a = max(a, 2*p[i]);
else b = max(b, 2*(L-p[i]));
}
o = min(L, a+b);
}
return o;
}
# | 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... |