結果
| 問題 |
No.1736 Princess vs. Dragoness
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-12 21:28:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 75 ms / 2,000 ms |
| コード長 | 350 bytes |
| コンパイル時間 | 351 ms |
| コンパイル使用メモリ | 82,360 KB |
| 実行使用メモリ | 77,092 KB |
| 最終ジャッジ日時 | 2025-07-04 14:02:25 |
| 合計ジャッジ時間 | 3,145 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
from heapq import heappop as pop, heappush as push, heapify
N, A, B, X, Y = map(int, input().split())
H = list(map(int, input().split()))
hh = list(map(lambda x: -x, H))
heapify(hh)
for _ in range(A):
h = -pop(hh)
h -= X
push(hh, -h)
sum_ = 0
for h in hh:
sum_ += max(0, -h)
if sum_ <= Y*B:
print("Yes")
else:
print("No")