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>
#define uwu return ans;
using namespace std;
long long delivery(int N, int K, int L, int p[]) {
long long ans = 0;
if(K == 1){
for(int i = 0; i < N; i++){
ans += min(p[i], L - p[i]);
}
}
else if(K == N){
int mn = 1e9 + 7, mx = 0;
for(int i = 0; i < N; i++){
mn = min(mn, p[i]);
mx = max(mx, p[i]);
}
ans = min({L, 2 * (L - mn), 2 * mx});
}
uwu
}
# | 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... |