結果

問題 No.9 モンスターのレベル上げ
ユーザー DialBird
提出日時 2019-07-25 15:26:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 672 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-07-02 06:04:45
合計ジャッジ時間 22,058 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heapify, heappush, heapreplace
from collections import deque

def main():
    """ main """
    # 1 <= 1500
    N = int(input())
    # 10000
    FRIENDS = [(i, 0) for i in list(map(int, input().split()))]
    ENEMIES = list(map(int, input().split()))

    max_value = 0
    enemies = deque(ENEMIES[:])
    # # 的の順番ごとに一つ一つ確認していく
    for n in range(N):
        friends = FRIENDS[:]
        enemies.rotate()
        for enemy in enemies:
            lv, cnt = friends[0]
            heapreplace(friends, (lv+enemy//2, cnt+1))
        max_value = max(max_value, max(cnt for lv, cnt in friends))

    print(max_value)

main()
0