# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
520988 | ColourAttila | Boxes with souvenirs (IOI15_boxes) | C++17 | 0 ms | 0 KiB |
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;
long long delivery(int N, int K, int L, int p[]) {
if(k == 1) {
long long ret = 0;
for(int i = 0; i < N; i++) {
ret += min(p[i], n-p[i]) * 2;
}
return ret;
}
sort(p, p+N);
return min(n/2, min(n-p[0], p[n-1])) * 2;
}