結果

問題 No.9 モンスターのレベル上げ
ユーザー neko_the_shadowneko_the_shadow
提出日時 2017-01-15 11:23:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 8,984 KB
最終ジャッジ日時 2023-08-23 10:57:48
合計ジャッジ時間 35,228 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,444 KB
testcase_01 AC 20 ms
8,416 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 18 ms
8,452 KB
testcase_11 AC 3,318 ms
8,984 KB
testcase_12 AC 3,966 ms
8,720 KB
testcase_13 AC 3,179 ms
8,860 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

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