Submission #588396

#TimeUsernameProblemLanguageResultExecution timeMemory
588396NicolaikrobBoxes with souvenirs (IOI15_boxes)C++17
10 / 100
1 ms304 KiB
#include <bits/stdc++.h> using namespace std; #include "boxes.h" long long delivery(int N, int K, int L, int p[]) { long long o = 0; if(L == 1) return 0; if(K == 1) for(int i = 0; i < N; i++) o += 2*min(p[i], L-p[i]); else { int a = 0, b = 0; for(int i = 0; i < N; i++) { if(p[i] <= L<<1) a = max(a, 2*p[i]); else b = max(b, 2*(L-p[i])); } o = min(L, a+b); } return o; }
#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...