結果
問題 | No.1736 Princess vs. Dragoness |
ユーザー |
![]() |
提出日時 | 2021-11-15 11:40:45 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 111 ms / 2,000 ms |
コード長 | 688 bytes |
コンパイル時間 | 407 ms |
コンパイル使用メモリ | 82,460 KB |
実行使用メモリ | 71,612 KB |
最終ジャッジ日時 | 2024-12-14 10:22:25 |
合計ジャッジ時間 | 3,919 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
n, a, b, x, y = map(int, input().split())h = [int(i) for i in input().split()]h.sort()def magicA():for i in range(n):if h[n-i-1] > 0:h[n-i-1] -= xbreakh.sort()def magicB():p = yi = 0while p > 0 and i < n:if h[i] > 0:d = min(p,h[i])h[i] -= dp -= di += 1def check():if max(h) <= 0:return Truereturn Falsedef is_clear():if check():print("Yes")else:print("No")while not(check()) and a > 0:magicA()a -= 1while not(check()) and b > 0:magicB()b -= 1is_clear()