結果
| 問題 |
No.1736 Princess vs. Dragoness
|
| コンテスト | |
| ユーザー |
dn6049949
|
| 提出日時 | 2021-11-14 21:38:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 80 ms / 2,000 ms |
| コード長 | 807 bytes |
| コンパイル時間 | 187 ms |
| コンパイル使用メモリ | 81,956 KB |
| 実行使用メモリ | 77,060 KB |
| 最終ジャッジ日時 | 2025-07-04 14:05:46 |
| 合計ジャッジ時間 | 3,361 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def IR(n):
return [I() for _ in range(n)]
def LIR(n):
return [LI() for _ in range(n)]
sys.setrecursionlimit(1000000)
mod = 1000000007
def main():
n,a,b,x,y = LI()
h = LI()
q = []
for i in h:
heappush(q,-i)
for _ in range(a):
if not q:
break
i = heappop(q)
i += x
if i < 0:
heappush(q,i)
s = -sum(q)
if s <= b*y:
print("Yes")
else:
print("No")
return
if __name__ == "__main__":
main()
dn6049949