結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-11-13 16:10:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,084 ms / 3,000 ms
コード長 377 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 104,724 KB
最終ジャッジ日時 2023-08-18 09:04:17
合計ジャッジ時間 37,864 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,344 KB
testcase_01 AC 79 ms
71,044 KB
testcase_02 AC 72 ms
71,356 KB
testcase_03 AC 84 ms
76,328 KB
testcase_04 AC 1,518 ms
103,948 KB
testcase_05 AC 1,922 ms
104,724 KB
testcase_06 AC 1,061 ms
102,776 KB
testcase_07 AC 87 ms
76,380 KB
testcase_08 AC 289 ms
91,948 KB
testcase_09 AC 409 ms
99,488 KB
testcase_10 AC 1,058 ms
88,076 KB
testcase_11 AC 678 ms
85,084 KB
testcase_12 AC 127 ms
77,988 KB
testcase_13 AC 1,028 ms
93,904 KB
testcase_14 AC 1,270 ms
96,928 KB
testcase_15 AC 1,038 ms
103,768 KB
testcase_16 AC 1,204 ms
85,572 KB
testcase_17 AC 637 ms
91,520 KB
testcase_18 AC 1,342 ms
90,816 KB
testcase_19 AC 369 ms
91,500 KB
testcase_20 AC 263 ms
82,920 KB
testcase_21 AC 678 ms
99,544 KB
testcase_22 AC 1,042 ms
100,924 KB
testcase_23 AC 1,703 ms
103,696 KB
testcase_24 AC 1,812 ms
103,360 KB
testcase_25 AC 2,084 ms
103,716 KB
testcase_26 AC 1,675 ms
102,128 KB
testcase_27 AC 2,068 ms
103,736 KB
testcase_28 AC 1,661 ms
102,184 KB
testcase_29 AC 1,986 ms
103,680 KB
testcase_30 AC 1,767 ms
103,840 KB
testcase_31 AC 1,678 ms
103,376 KB
testcase_32 AC 1,887 ms
102,516 KB
testcase_33 AC 101 ms
77,052 KB
testcase_34 AC 89 ms
76,876 KB
testcase_35 AC 118 ms
77,288 KB
testcase_36 AC 112 ms
77,312 KB
testcase_37 AC 97 ms
77,308 KB
testcase_38 AC 121 ms
77,612 KB
testcase_39 AC 109 ms
76,928 KB
testcase_40 AC 105 ms
76,992 KB
testcase_41 AC 121 ms
76,976 KB
testcase_42 AC 107 ms
77,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import *

n, a, b, x, y = map(int, input().split())
h = list(map(int, input().split()))
def ok(X):
	h2 = [min(0, X - h[i]) for i in range(n)]
	heapify(h2)
	for i in range(a):
		ma = min(0, heappop(h2) + x)
		heappush(h2, ma)
	return True if sum(h2) * -1 <= b * y else False
l, r = -1, 10 ** 9
while r - l > 1:
	m = (l + r) // 2
	if ok(m): r = m
	else: l = m
print(r)
0