結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,980 KB
testcase_01 AC 16 ms
7,940 KB
testcase_02 AC 2,306 ms
8,476 KB
testcase_03 AC 1,725 ms
8,500 KB
testcase_04 AC 947 ms
8,380 KB
testcase_05 AC 638 ms
8,460 KB
testcase_06 AC 232 ms
7,912 KB
testcase_07 AC 21 ms
7,980 KB
testcase_08 AC 307 ms
7,984 KB
testcase_09 AC 2,193 ms
8,572 KB
testcase_10 AC 16 ms
8,024 KB
testcase_11 AC 2,103 ms
8,308 KB
testcase_12 AC 2,787 ms
8,348 KB
testcase_13 AC 2,032 ms
8,492 KB
testcase_14 AC 2,228 ms
8,532 KB
testcase_15 AC 2,077 ms
8,500 KB
testcase_16 AC 52 ms
8,040 KB
testcase_17 AC 1,279 ms
8,444 KB
testcase_18 AC 1,105 ms
8,400 KB
testcase_19 AC 36 ms
8,028 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):
        t = h[0]
        heapq.heapreplace(h, (B[j-i]+t[0], t[1]+1))
    min_max_cnt = min(min_max_cnt, max(t[1] for t in h))
print(min_max_cnt)
0