結果

問題 No.9 モンスターのレベル上げ
ユーザー matsu7874matsu7874
提出日時 2015-08-16 22:45:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,169 ms / 5,000 ms
コード長 402 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,788 KB
実行使用メモリ 8,612 KB
最終ジャッジ日時 2023-09-06 04:06:57
合計ジャッジ時間 27,841 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,016 KB
testcase_01 AC 16 ms
8,044 KB
testcase_02 AC 2,778 ms
8,520 KB
testcase_03 AC 2,161 ms
8,612 KB
testcase_04 AC 1,156 ms
8,324 KB
testcase_05 AC 797 ms
8,348 KB
testcase_06 AC 282 ms
8,044 KB
testcase_07 AC 21 ms
8,008 KB
testcase_08 AC 371 ms
8,436 KB
testcase_09 AC 2,707 ms
8,528 KB
testcase_10 AC 16 ms
7,992 KB
testcase_11 AC 2,541 ms
8,364 KB
testcase_12 AC 3,169 ms
8,428 KB
testcase_13 AC 2,426 ms
8,556 KB
testcase_14 AC 2,709 ms
8,540 KB
testcase_15 AC 2,448 ms
8,564 KB
testcase_16 AC 59 ms
7,940 KB
testcase_17 AC 1,573 ms
8,528 KB
testcase_18 AC 1,348 ms
8,412 KB
testcase_19 AC 40 ms
8,072 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 = heapq.heappop(h)
        cnt = t[1]+1
        heapq.heappush(h, (B[j-i]//2+t[0], cnt))
    min_max_cnt = min(min_max_cnt, max(t[1] for t in h))
print(min_max_cnt)
0