結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー 河野竜也河野竜也
提出日時 2022-06-22 16:11:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 445 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 27,156 KB
最終ジャッジ日時 2024-04-23 19:29:22
合計ジャッジ時間 10,036 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,880 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 314 ms
10,752 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 AC 364 ms
10,752 KB
testcase_08 AC 636 ms
17,184 KB
testcase_09 AC 963 ms
20,272 KB
testcase_10 AC 2,076 ms
15,044 KB
testcase_11 AC 1,528 ms
14,176 KB
testcase_12 AC 103 ms
11,776 KB
testcase_13 AC 2,175 ms
17,820 KB
testcase_14 AC 2,619 ms
18,896 KB
testcase_15 AC 2,297 ms
21,784 KB
testcase_16 AC 2,432 ms
13,912 KB
testcase_17 AC 1,274 ms
16,296 KB
testcase_18 AC 2,628 ms
15,956 KB
testcase_19 AC 676 ms
16,160 KB
testcase_20 AC 334 ms
13,440 KB
testcase_21 AC 1,398 ms
19,732 KB
testcase_22 AC 2,224 ms
20,640 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 AC 28 ms
10,752 KB
testcase_34 AC 33 ms
10,880 KB
testcase_35 AC 34 ms
10,752 KB
testcase_36 AC 39 ms
10,752 KB
testcase_37 AC 36 ms
10,880 KB
testcase_38 AC 32 ms
10,752 KB
testcase_39 AC 37 ms
11,008 KB
testcase_40 AC 29 ms
10,880 KB
testcase_41 AC 32 ms
10,752 KB
testcase_42 AC 29 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
n,a,b,x,y=map(int,input().split())
h=list(map(int,input().split()))
def check(k):
  c=[]
  for i in range(n):
    c.append(min(0,k-h[i]))
  heapq.heapify(c)

  for i in range(a):
    target=heapq.heappop(c)
    target=min(0,x+target)
    heapq.heappush(c,target)

  if (-1)*sum(c)<=b*y:
    return True
  else:
    return False

ub=10**9
lb=-1
while ub-lb>1:
  mid=(ub+lb)//2
  if check(mid):
    ub=mid
  else:
    lb=mid
print(ub)
0