結果

問題 No.9 モンスターのレベル上げ
ユーザー neko_the_shadow
提出日時 2017-01-15 11:23:11
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-12-21 13:09:26
合計ジャッジ時間 44,189 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 14 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import copy, heapq

if __name__ == '__main__':
    n = int(input())
    abstract_ally = [(int(a), 0) for a in input().split()]
    enemy = [int(b) for b in input().split()]

    heapq.heapify(abstract_ally)

    answer = 0
    for start in range(n):
        max_cnt = 0
        ally = copy.copy(abstract_ally)
        for diff in range(n):
            level, cnt = heapq.heappop(ally)
            i = (start + diff) % n

            max_cnt = max(max_cnt, cnt + 1)
            heapq.heappush(ally, (level + enemy[i] // 2, cnt + 1))
        
        answer = max(max_cnt, answer)
    
    print(answer)
0