Submission #521047

#TimeUsernameProblemLanguageResultExecution timeMemory
521047Valaki2Boxes with souvenirs (IOI15_boxes)C++14
0 / 100
1 ms204 KiB
#include "boxes.h" #define ll long long #include <bits/stdc++.h> using namespace std; ll delivery(int N, int K, int L, int p[]) { if(K == 1) { ll ans = 0; for(int i = 0; i < N; i++) { ans += min(p[i], L - p[i]); } return ans; } ll ans = L; sort(p, p + N); for(int i = 0; i < N - 1; i++) { ans = min(ans, (long long) 2 * p[i] + 2 * (L - p[i + 1])); } return ans; }
#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...