結果

問題 No.9 モンスターのレベル上げ
ユーザー matsu7874matsu7874
提出日時 2015-08-16 22:46:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,853 ms / 5,000 ms
コード長 375 bytes
コンパイル時間 1,650 ms
コンパイル使用メモリ 10,864 KB
実行使用メモリ 8,588 KB
最終ジャッジ日時 2023-09-06 04:08:03
合計ジャッジ時間 24,443 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,976 KB
testcase_01 AC 16 ms
8,072 KB
testcase_02 AC 2,404 ms
8,504 KB
testcase_03 AC 1,902 ms
8,472 KB
testcase_04 AC 1,005 ms
8,452 KB
testcase_05 AC 669 ms
8,360 KB
testcase_06 AC 241 ms
7,956 KB
testcase_07 AC 20 ms
8,036 KB
testcase_08 AC 317 ms
7,952 KB
testcase_09 AC 2,326 ms
8,528 KB
testcase_10 AC 16 ms
7,988 KB
testcase_11 AC 2,213 ms
8,408 KB
testcase_12 AC 2,853 ms
8,496 KB
testcase_13 AC 2,088 ms
8,520 KB
testcase_14 AC 2,313 ms
8,544 KB
testcase_15 AC 2,106 ms
8,420 KB
testcase_16 AC 53 ms
7,980 KB
testcase_17 AC 1,351 ms
8,588 KB
testcase_18 AC 1,140 ms
8,444 KB
testcase_19 AC 38 ms
8,004 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