Submission #886434

#TimeUsernameProblemLanguageResultExecution timeMemory
886434heavylightdecompBoxes with souvenirs (IOI15_boxes)C++14
20 / 100
1 ms600 KiB
//K = N Assigning each person to a "half" #include "boxes.h" #include <bits/stdc++.h> using namespace std; #define ll long long long long delivery(int N, int K, int L, int p[]) { if(K == N) { ll obvious = L; ll lef = 0; ll rig = L; for(int i = 0; i < N; i++) { if(p[i] <= L/2) { lef = max(lef, (ll)p[i]); } else { rig = min(rig, (ll)p[i]); } } ll other = 2ll*lef + 2ll*(L-rig); return min(obvious, other); } else { ll res = 0; for(int i = 0; i < N; i++) { res += 2ll * min(p[i], L-p[i]); } 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...