結果

問題 No.9 モンスターのレベル上げ
ユーザー しらっ亭しらっ亭
提出日時 2015-08-15 03:22:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,351 ms / 5,000 ms
コード長 513 bytes
コンパイル時間 461 ms
コンパイル使用メモリ 10,856 KB
実行使用メモリ 8,740 KB
最終ジャッジ日時 2023-09-06 04:01:51
合計ジャッジ時間 20,091 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,028 KB
testcase_01 AC 15 ms
8,024 KB
testcase_02 AC 1,926 ms
8,560 KB
testcase_03 AC 1,507 ms
8,492 KB
testcase_04 AC 806 ms
8,564 KB
testcase_05 AC 546 ms
8,560 KB
testcase_06 AC 193 ms
8,012 KB
testcase_07 AC 19 ms
8,036 KB
testcase_08 AC 254 ms
7,996 KB
testcase_09 AC 1,859 ms
8,740 KB
testcase_10 AC 16 ms
8,016 KB
testcase_11 AC 1,694 ms
8,620 KB
testcase_12 AC 2,351 ms
8,512 KB
testcase_13 AC 1,608 ms
8,612 KB
testcase_14 AC 1,835 ms
8,672 KB
testcase_15 AC 1,682 ms
8,468 KB
testcase_16 AC 43 ms
7,932 KB
testcase_17 AC 1,081 ms
8,616 KB
testcase_18 AC 924 ms
8,388 KB
testcase_19 AC 32 ms
8,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq


def solve():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    z = [0] * N
    C = list(zip(A, z))
    heapq.heapify(C)

    mi = N
    for i in range(N):
        ms = C[:]
        for j in range(i, i + N):
            k = j % N
            l, n = ms[0]
            heapq.heapreplace(ms, (l + B[k] // 2, n + 1))
        ma = max(m[1] for m in ms)
        if ma < mi:
            mi = ma

    print(mi)


if __name__ == '__main__':
    solve()
0