結果

問題 No.9 モンスターのレベル上げ
ユーザー tktk_snsn
提出日時 2021-01-02 05:42:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 95,528 KB
最終ジャッジ日時 2024-10-11 19:33:19
合計ジャッジ時間 14,738 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split())) * 2

ans = 0
for i in range(N):
    P = [(a, 0) for a in A]
    heapq.heapify(P)
    for j in range(N):
        a, c = heapq.heappop(P)
        a += B[i+j]//2
        c += 1
        heapq.heappush(P, (a, c))
    score = max(c for _, c in P)
    ans = max(ans, score)

print(ans)
0