제출 #588396

#제출 시각아이디문제언어결과실행 시간메모리
588396Nicolaikrob선물상자 (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...