結果

問題 No.1071 ベホマラー
ユーザー pluto77pluto77
提出日時 2020-06-23 11:39:31
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 235 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 10,848 KB
実行使用メモリ 21,712 KB
最終ジャッジ日時 2023-09-16 19:50:35
合計ジャッジ時間 4,667 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,772 KB
testcase_01 AC 15 ms
7,808 KB
testcase_02 AC 15 ms
7,848 KB
testcase_03 AC 15 ms
7,892 KB
testcase_04 AC 15 ms
7,932 KB
testcase_05 AC 15 ms
7,936 KB
testcase_06 AC 15 ms
7,868 KB
testcase_07 AC 16 ms
7,768 KB
testcase_08 AC 15 ms
7,936 KB
testcase_09 AC 16 ms
7,868 KB
testcase_10 AC 196 ms
19,128 KB
testcase_11 AC 186 ms
18,668 KB
testcase_12 AC 122 ms
15,020 KB
testcase_13 AC 165 ms
17,688 KB
testcase_14 AC 205 ms
19,636 KB
testcase_15 AC 226 ms
21,632 KB
testcase_16 AC 235 ms
21,588 KB
testcase_17 AC 229 ms
21,712 KB
testcase_18 AC 223 ms
21,560 KB
testcase_19 AC 233 ms
21,628 KB
testcase_20 AC 184 ms
21,296 KB
testcase_21 AC 190 ms
21,472 KB
testcase_22 AC 188 ms
21,464 KB
testcase_23 AC 199 ms
21,384 KB
testcase_24 AC 224 ms
21,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1071
N,K,X,Y=map(int,input().split())
A=list(map(int,input().split()))
B=[0]*N
for i in range(0,N):
 B[i]=(A[i]+K-2)//K
B.sort()
R=[0]*(N+1)
for i in range(0,N):
 R[N-i-1]=R[N-i]+B[N-i-1]
res=R[0]*X
for i in range(0,N):
 t=B[i]*Y+(R[i+1]-(N-1-i)*B[i])*X
 res=min(res,t)
print(res)
0