Submission #588541

#TimeUsernameProblemLanguageResultExecution timeMemory
588541SifferBoxes with souvenirs (IOI15_boxes)C++14
20 / 100
1 ms300 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 r = 0; if(K==1) { for(int i = 0; i < N; i++) r += min(p[i], L-p[i])<<1; } else { ll m = 0, mm = 0; for(int i = 0; i < N; i++) { if(p[i] <= (L>>1)) m = max(p[i]+0ll, m); else mm = max(L-p[i]+0ll,mm); } r = min(L+0ll, mm+mm+m+m); } return r; }
#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...