結果
問題 | No.1736 Princess vs. Dragoness |
ユーザー |
|
提出日時 | 2024-12-29 11:10:50 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 139 ms / 2,000 ms |
コード長 | 555 bytes |
コンパイル時間 | 350 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 77,044 KB |
最終ジャッジ日時 | 2024-12-29 11:10:56 |
合計ジャッジ時間 | 4,619 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import heapqN,A,B,X,Y = map(int,input().split())H = list(map(int,input().split()))heap = []for i in range(N):heapq.heappush(heap,-H[i])cnt = 0while heap and cnt<A:h = -heapq.heappop(heap)h -= Xcnt += 1if h>0:heapq.heappush(heap,-h)for _ in range(B):p = YA = []while p>0 and heap:h = -heapq.heappop(heap)d = min(h,p)h -= dp -= dif h>0:A.append(h)for a in A:heapq.heappush(heap,-a)if heap:print("No")else:print("Yes")