# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
604258 | cheissmart | Boxes with souvenirs (IOI15_boxes) | C++14 | 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>
#define F first
#define S second
#define V vector
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(v) (v).begin(), (v).end()
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;
const int INF = 1e9 + 7;
ll delivery(int n, int k, int l, int p[]) {
vi a;
for(int i = 0; i < n; i++)
if(p[i]) a.PB(p[i]);
n = SZ(a);
ll ans = 0;
for(int i = 0; i < n; i++) {
ans += min(a[i], l - a[i]);
}
return ans;
}