| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1331633 | uranhishig | Boxes with souvenirs (IOI15_boxes) | C++20 | 0 ms | 344 KiB |
#include "boxes.h"
#include<bits/stdc++.h>
using namespace std;
// #define int long long
long long delivery(int n, int k, int l, int p[]) {
if(k == 1) {
long long ans = 0;
for (int i = 0; i < n; i++) {
long long x = min(p[i], l - p[i]);
ans += x + x;
}
return ans;
}
else if(k == n) {
// sort(p, p + n);
long long mx = 0;
for (int i = 0; i < n; i++) {
long long d = min(p[i] * 1LL, (l - p[i]) * 1LL);
mx = max(mx, d);
}
long long ans = min({2LL * mx, l * 1LL});
return ans;
}
}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... | ||||
