結果
| 問題 |
No.1071 ベホマラー
|
| コンテスト | |
| ユーザー |
rythem00359
|
| 提出日時 | 2020-08-25 17:17:32 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 263 bytes |
| コンパイル時間 | 180 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 26,780 KB |
| 最終ジャッジ日時 | 2024-11-06 11:32:13 |
| 合計ジャッジ時間 | 4,870 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 5 TLE * 1 -- * 14 |
ソースコード
n,k,x,y=map(int,input().split())
a=sorted([*map(lambda x:(int(x)-1)//k if (int(x)-1)%k==0 else (int(x)-1)//k+1,input().split())])
ans=0
b=n
while b>0:
m=a[n-b]
ans+=y*m if y<b*x else b*x*m
a=[*map(lambda h: max(0,h-m),a)]
b=n-a.count(0)
print(ans)
rythem00359