結果
| 問題 |
No.1736 Princess vs. Dragoness
|
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2021-11-12 21:44:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 117 ms / 2,000 ms |
| コード長 | 446 bytes |
| コンパイル時間 | 195 ms |
| コンパイル使用メモリ | 82,360 KB |
| 実行使用メモリ | 77,224 KB |
| 最終ジャッジ日時 | 2025-07-04 14:03:36 |
| 合計ジャッジ時間 | 4,215 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
import heapq
N,A,B,X,Y = map(int, input().split())
H = list(map(int, input().split()))
HQ = []
for i in range(N):
heapq.heappush(HQ,(-H[i],i))
for _ in range(A):
hi,i = heapq.heappop(HQ)
H[i]-=X
heapq.heappush(HQ,(-H[i],i))
for i in range(B):
y = Y
j = 0
while y>0 and j<N:
d = min(y,H[j])
if d>0:
H[j]-=d
y-=d
j+=1
if max(H)<=0:
print('Yes')
else:
print('No')
H20