結果
問題 | No.1736 Princess vs. Dragoness |
ユーザー |
![]() |
提出日時 | 2021-10-14 22:41:01 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 80 ms / 2,000 ms |
コード長 | 388 bytes |
コンパイル時間 | 171 ms |
コンパイル使用メモリ | 82,636 KB |
実行使用メモリ | 76,820 KB |
最終ジャッジ日時 | 2024-11-25 10:55:50 |
合計ジャッジ時間 | 3,176 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import heapq n,a,b,x,y=map(int,input().split()) h=list(map(int,input().split())) if 1<=n<=3000 and 0<=a<=3000 and 0<=b<=3000 and 1<=x<=10**9 and 1<=y<=10**9 and min(h)>=1 and max(h)<=10**9: pass else: raise Exception hq=[] for i in h: heapq.heappush(hq,-i) for i in range(a): t=heapq.heappop(hq) heapq.heappush(hq,min(0,t+x)) if -sum(hq)<=b*y: print('Yes') else: print('No')