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;
typedef long long ll;
ll delivery(int N, int K, int L, int p[]) {
ll r = 0;
if(K==1) {
for(int i = 0; i < N; i++) r += min(p[i], L-p[i])<<1;
} else {
ll m = 0, mm = 0;
for(int i = 0; i < N; i++) {
if(p[i] <= (L>>1)) m = max(p[i]+0ll, m);
else mm = max(L-p[i]+0ll,mm);
}
r = min(L+0ll, mm+mm+m+m);
}
return r;
}
# | 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... |