結果

問題 No.9 モンスターのレベル上げ
ユーザー matsu7874matsu7874
提出日時 2015-08-17 19:00:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,766 ms / 5,000 ms
コード長 370 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 10,760 KB
実行使用メモリ 8,608 KB
最終ジャッジ日時 2023-09-06 04:11:08
合計ジャッジ時間 23,968 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,012 KB
testcase_01 AC 17 ms
8,072 KB
testcase_02 AC 2,317 ms
8,516 KB
testcase_03 AC 1,841 ms
8,588 KB
testcase_04 AC 988 ms
7,992 KB
testcase_05 AC 675 ms
8,416 KB
testcase_06 AC 239 ms
8,124 KB
testcase_07 AC 20 ms
8,020 KB
testcase_08 AC 306 ms
7,912 KB
testcase_09 AC 2,231 ms
8,528 KB
testcase_10 AC 16 ms
7,972 KB
testcase_11 AC 2,164 ms
8,380 KB
testcase_12 AC 2,766 ms
8,388 KB
testcase_13 AC 2,064 ms
8,508 KB
testcase_14 AC 2,249 ms
8,608 KB
testcase_15 AC 2,065 ms
8,488 KB
testcase_16 AC 52 ms
7,948 KB
testcase_17 AC 1,340 ms
8,492 KB
testcase_18 AC 1,105 ms
7,960 KB
testcase_19 AC 38 ms
8,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [int(x)//2 for x in input().split()]
H = [(a,0) for a in A]
# heapq.heapify(H)
min_max_cnt = N
for i in range(N):
    h = H[:]
    for j in range(N):
        s,t = h[0]
        heapq.heapreplace(h, (B[j-i]+s, t+1))
    min_max_cnt = min(min_max_cnt, max(t[1] for t in h))
print(min_max_cnt)
0