結果
問題 | No.1736 Princess vs. Dragoness |
ユーザー |
![]() |
提出日時 | 2021-11-12 21:34:29 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 171 ms / 2,000 ms |
コード長 | 895 bytes |
コンパイル時間 | 150 ms |
コンパイル使用メモリ | 82,104 KB |
実行使用メモリ | 90,672 KB |
最終ジャッジ日時 | 2024-11-25 17:18:55 |
合計ジャッジ時間 | 6,592 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import itertools as iterimport collections as collimport heapq as hqimport bisect as bisfrom decimal import Decimal as decfrom copy import deepcopy as dcopyimport mathimport syssys.setrecursionlimit(10**6)def input():return sys.stdin.readline().rstrip()def getN():return int(sys.stdin.readline())def getNs():return map(int,sys.stdin.readline().split())def getList():return list(map(int,sys.stdin.readline().split()))def strinps(n):return [sys.stdin.readline().rstrip() for _ in range(n)]pi = 3.141592653589793mod = 10**9+7MOD = 998244353INF = math.infdx = [1,0,-1,0]; dy = [0,1,0,-1]"""Main Code"""n,a,b,x,y = getNs()h = getList()hque = []for i in h:hq.heappush(hque,-i)for _ in [0]*a:hp = hq.heappop(hque)hq.heappush(hque,hp+x)s = 0while(hque):hp = -hq.heappop(hque)#print(hp)s += max(0,hp)if(s <= y*b):print("Yes")else:print("No")