結果

問題 No.9 モンスターのレベル上げ
ユーザー Kude
提出日時 2020-09-03 07:52:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 878 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 123,416 KB
最終ジャッジ日時 2024-11-22 17:52:38
合計ジャッジ時間 39,034 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 2 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappush, heappop
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
b = b + b
ans = n
for s in range(n):
    q = []
    cnt = [0] * n
    for i, ai in enumerate(a):
        heappush(q, (ai, 0, i))
    for j in range(s, s + n):
        ai, _, i = heappop(q)
        cnt[i] += 1
        heappush(q, (ai + b[j] // 2, j, i))
    ans = min(ans, max(cnt))
print(ans)
0