結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,004 KB
testcase_01 AC 17 ms
8,044 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 17 ms
8,048 KB
testcase_11 AC 1,561 ms
8,600 KB
testcase_12 WA -
testcase_13 AC 1,496 ms
8,576 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

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
    # # 的の順番ごとに一つ一つ確認していく
    for n in range(N):
        friends = FRIENDS[:]
        enemies = ENEMIES[n:] + ENEMIES[:n]
        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