// Problem: https://oj.uz/problem/view/IOI15_boxes
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
ll delivery(int n, int k, int l, int pos[]) {
sort(pos, pos + n);
if (k == 1) { // subtask 1
return (n * (l - 1) * 1ll + min(2ll * min(pos[0], l - pos[n - 1] + 1), 1ll * l));
} else if (k == n) { // subtask 2
return l;
} else { // subtask 3-7
return 47;
}
}
# | 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... |