結果

問題 No.9 モンスターのレベル上げ
ユーザー nisizawa
提出日時 2017-12-19 11:50:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 465 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-06-24 00:20:27
合計ジャッジ時間 43,362 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq

n = int(input())
a_ls = [int(a) for a in input().split()]
b_ls = [int(b) for b in input().split()]

ct_max_min = float('inf')
for i in range(n):
    hq = [(a, 0) for a in a_ls]
    heapq.heapify(hq)
    
    ct_max = 0
    for j in range(n):
        lv, ct = hq[0]
        lv += b_ls[(i + j) % n] // 2
        ct += 1
        heapq.heapreplace(hq, (lv, ct))
        ct_max = max(ct, ct_max)

    ct_max_min = min(ct_max_min, ct_max)

print(ct_max_min)
0