結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,068 KB
testcase_01 AC 16 ms
8,000 KB
testcase_02 AC 2,396 ms
8,512 KB
testcase_03 AC 1,840 ms
8,488 KB
testcase_04 AC 996 ms
8,400 KB
testcase_05 AC 676 ms
8,168 KB
testcase_06 AC 236 ms
8,140 KB
testcase_07 AC 21 ms
7,920 KB
testcase_08 AC 316 ms
8,160 KB
testcase_09 AC 2,261 ms
8,512 KB
testcase_10 AC 17 ms
8,136 KB
testcase_11 AC 2,172 ms
8,364 KB
testcase_12 AC 2,766 ms
8,460 KB
testcase_13 AC 2,095 ms
8,620 KB
testcase_14 AC 2,271 ms
8,584 KB
testcase_15 AC 2,071 ms
8,456 KB
testcase_16 AC 52 ms
8,020 KB
testcase_17 AC 1,325 ms
8,392 KB
testcase_18 AC 1,141 ms
8,512 KB
testcase_19 AC 39 ms
7,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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