Submission #1033883

#TimeUsernameProblemLanguageResultExecution timeMemory
1033883fv3Boxes with souvenirs (IOI15_boxes)C++14
10 / 100
1 ms444 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll delivery(int N_, int K_, int L_, int p[]) { ll L = L_; ll N = N_; ll K = K_; vector<ll> v(N); for (int i = 0; i < N; i++) v[i] = p[i]; if (K == 1) { ll res = 0; for (int i = 0; i < N; i++) res += min(v[i], L - v[i]) * 2; return res; } sort(v.begin(), v.end()); ll res = min({L, v.back() * 2, (L - v.front()) * 2}); return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...