| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1343715 | bethance | Boxes with souvenirs (IOI15_boxes) | C++20 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
using namespace std;
int N, K, L;
vector<int> positions;
int delivery(int N, int K, int L, vector<int> positions) {
int ans = 0;
int mid = L / 2;
for (int i = 0; i < N; i++) {
if (positions[i] <= mid) {
ans += 2 * positions[i];
} else {
ans += 2 * (N - positions[i]);
}
}
return ans;
}