結果
問題 | No.1071 ベホマラー |
ユーザー |
|
提出日時 | 2020-06-05 22:16:13 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 738 ms / 2,000 ms |
コード長 | 908 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 52,104 KB |
最終ジャッジ日時 | 2024-12-17 15:55:26 |
合計ジャッジ時間 | 15,066 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 20 |
ソースコード
import numpy as npimport mathn,k,x,y = map(int , input().split())a = list(map(int, input().split()))a.sort()a = np.array(a)ans = 0count = 0val = y//x# print(val)a-=1while True:if max(a) > 0:if val > n:for i in a:ans += math.ceil(i/k)# print(i)# print(a)print(ans)exit()while val >= 0:while a[-val-1] > 1:# a -= ktmp = math.ceil(a[-val-1]/k)a -= k * tmpans += y * tmp# print('a')# print(a)while a[-val] > 1:tmp = math.ceil(a[-val]/k)a[-val] -= k * tmpans += x * tmp# print('b')# print(a)val -= 1# print(a)else:print(ans)exit()