結果

問題 No.1160 Strange Bowling
ユーザー ThetaTheta
提出日時 2022-11-14 18:28:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 309 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 10,552 KB
実行使用メモリ 17,432 KB
最終ジャッジ日時 2023-10-14 01:18:50
合計ジャッジ時間 7,224 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,936 KB
testcase_01 AC 16 ms
8,072 KB
testcase_02 AC 16 ms
8,016 KB
testcase_03 AC 16 ms
7,892 KB
testcase_04 AC 16 ms
7,936 KB
testcase_05 AC 16 ms
7,944 KB
testcase_06 AC 16 ms
7,864 KB
testcase_07 AC 17 ms
7,944 KB
testcase_08 AC 16 ms
7,908 KB
testcase_09 AC 16 ms
7,940 KB
testcase_10 AC 232 ms
14,072 KB
testcase_11 AC 129 ms
11,292 KB
testcase_12 AC 71 ms
9,760 KB
testcase_13 AC 43 ms
9,072 KB
testcase_14 AC 208 ms
13,556 KB
testcase_15 AC 60 ms
9,432 KB
testcase_16 AC 74 ms
9,784 KB
testcase_17 AC 193 ms
12,924 KB
testcase_18 AC 138 ms
11,488 KB
testcase_19 AC 98 ms
10,452 KB
testcase_20 AC 164 ms
12,180 KB
testcase_21 AC 131 ms
11,492 KB
testcase_22 AC 52 ms
9,176 KB
testcase_23 AC 51 ms
9,260 KB
testcase_24 AC 49 ms
9,004 KB
testcase_25 AC 103 ms
10,632 KB
testcase_26 AC 61 ms
9,436 KB
testcase_27 AC 147 ms
11,924 KB
testcase_28 AC 65 ms
9,404 KB
testcase_29 AC 207 ms
13,204 KB
testcase_30 AC 309 ms
17,432 KB
testcase_31 AC 176 ms
12,580 KB
testcase_32 AC 64 ms
9,556 KB
testcase_33 AC 128 ms
11,456 KB
testcase_34 AC 124 ms
11,024 KB
testcase_35 AC 275 ms
15,104 KB
testcase_36 AC 16 ms
7,896 KB
testcase_37 AC 16 ms
7,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import inf


def main():
    scores_normal = [0]
    scores_bonus = [-inf]

    for idx in range(int(input())):
        p, a = map(int, input().split())
        scores_normal.append(
            max(scores_normal[idx]+p, scores_bonus[idx]+2*p)
        )
        scores_bonus.append(
            max(scores_normal[idx]+a, scores_bonus[idx]+2*a)
        )
    print(max(scores_normal[-1], scores_bonus[-1]))


if __name__ == "__main__":
    main()
0