結果

問題 No.9 モンスターのレベル上げ
ユーザー DialBirdDialBird
提出日時 2019-07-25 15:20:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 10,924 KB
実行使用メモリ 9,096 KB
最終ジャッジ日時 2023-09-14 23:52:14
合計ジャッジ時間 20,428 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,644 KB
testcase_01 AC 20 ms
8,668 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 19 ms
8,604 KB
testcase_11 AC 1,779 ms
8,976 KB
testcase_12 WA -
testcase_13 AC 1,762 ms
8,952 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def main():
    """ main """
    N = int(input())
    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