結果

問題 No.1071 ベホマラー
ユーザー pia-19pia-19
提出日時 2020-06-23 11:37:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 325 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 19,228 KB
最終ジャッジ日時 2023-09-16 19:50:15
合計ジャッジ時間 3,191 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,792 KB
testcase_01 RE -
testcase_02 AC 15 ms
7,740 KB
testcase_03 AC 15 ms
7,912 KB
testcase_04 AC 15 ms
7,808 KB
testcase_05 AC 15 ms
7,792 KB
testcase_06 AC 16 ms
7,736 KB
testcase_07 AC 14 ms
7,808 KB
testcase_08 AC 14 ms
7,824 KB
testcase_09 AC 15 ms
7,744 KB
testcase_10 AC 80 ms
17,268 KB
testcase_11 AC 83 ms
16,752 KB
testcase_12 AC 58 ms
13,640 KB
testcase_13 AC 92 ms
15,732 KB
testcase_14 AC 92 ms
17,440 KB
testcase_15 AC 102 ms
19,228 KB
testcase_16 AC 102 ms
19,112 KB
testcase_17 AC 125 ms
19,044 KB
testcase_18 AC 140 ms
18,788 KB
testcase_19 AC 126 ms
19,112 KB
testcase_20 RE -
testcase_21 AC 75 ms
18,904 KB
testcase_22 RE -
testcase_23 AC 75 ms
18,788 KB
testcase_24 AC 102 ms
18,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K, X, Y = map(int,input().split())
ls = list(map(int,input().split()))
ls.sort(reverse = True)

for i in range(N):
    ls[i] = - ((-ls[i] + 1) // K)
    
a = Y // X #a以下はベホイミ
b = ls[a]
ans = Y * b

for i in range(N):
    if ls[i] > b:
      ans += (ls[i] - b) * X 
    else:
        break
    
print(ans)    
0