結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,024 KB
testcase_01 AC 17 ms
8,004 KB
testcase_02 AC 2,386 ms
8,504 KB
testcase_03 AC 1,871 ms
8,520 KB
testcase_04 AC 983 ms
8,392 KB
testcase_05 AC 676 ms
8,508 KB
testcase_06 AC 244 ms
7,944 KB
testcase_07 AC 19 ms
7,980 KB
testcase_08 AC 311 ms
7,948 KB
testcase_09 AC 2,294 ms
8,484 KB
testcase_10 AC 16 ms
8,004 KB
testcase_11 AC 2,219 ms
8,532 KB
testcase_12 AC 2,800 ms
8,488 KB
testcase_13 AC 2,065 ms
8,620 KB
testcase_14 AC 2,283 ms
8,440 KB
testcase_15 AC 2,101 ms
8,508 KB
testcase_16 AC 53 ms
8,112 KB
testcase_17 AC 1,370 ms
8,548 KB
testcase_18 AC 1,126 ms
8,504 KB
testcase_19 AC 37 ms
8,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N = int(input())
A = [int(x) for x in input().split()]
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