結果
| 問題 |
No.1736 Princess vs. Dragoness
|
| コンテスト | |
| ユーザー |
Shirapon_pon
|
| 提出日時 | 2021-11-15 11:39:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 698 bytes |
| コンパイル時間 | 314 ms |
| コンパイル使用メモリ | 82,072 KB |
| 実行使用メモリ | 71,372 KB |
| 最終ジャッジ日時 | 2024-12-14 10:17:34 |
| 合計ジャッジ時間 | 3,789 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 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] -= x
break
h.sort()
def magicB():
p = y
i = 0
while p > 0 and i < n:
if h[i] > 0:
d = min(p,h[i])
h[i] -= d
p -= d
i += 1
def check():
if max(h) <= 0:
return True
return False
def is_clear():
if check():
print("Yes")
else:
print("No")
while not(check()) and a > 0:
magicA()
a -= 1
while not(check()) and b > 0:
magicB()
b -= 1
print(h)
is_clear()
Shirapon_pon