結果

問題 No.1160 Strange Bowling
ユーザー yansi819yansi819
提出日時 2024-05-08 09:41:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 173 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 82,120 KB
実行使用メモリ 92,648 KB
最終ジャッジ日時 2024-05-08 09:41:51
合計ジャッジ時間 5,065 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,448 KB
testcase_01 AC 35 ms
52,268 KB
testcase_02 AC 35 ms
52,692 KB
testcase_03 AC 38 ms
52,636 KB
testcase_04 AC 36 ms
52,860 KB
testcase_05 AC 38 ms
52,956 KB
testcase_06 AC 38 ms
53,544 KB
testcase_07 AC 39 ms
52,400 KB
testcase_08 AC 38 ms
52,216 KB
testcase_09 AC 37 ms
52,444 KB
testcase_10 AC 162 ms
92,648 KB
testcase_11 AC 119 ms
85,296 KB
testcase_12 AC 92 ms
77,596 KB
testcase_13 AC 84 ms
77,036 KB
testcase_14 AC 136 ms
85,156 KB
testcase_15 AC 88 ms
77,408 KB
testcase_16 AC 98 ms
80,736 KB
testcase_17 AC 130 ms
85,072 KB
testcase_18 AC 113 ms
82,448 KB
testcase_19 AC 101 ms
79,764 KB
testcase_20 AC 148 ms
82,700 KB
testcase_21 AC 114 ms
84,728 KB
testcase_22 AC 84 ms
77,316 KB
testcase_23 AC 81 ms
77,212 KB
testcase_24 AC 84 ms
77,240 KB
testcase_25 AC 98 ms
79,872 KB
testcase_26 AC 86 ms
76,880 KB
testcase_27 AC 110 ms
82,344 KB
testcase_28 AC 85 ms
77,292 KB
testcase_29 AC 127 ms
84,884 KB
testcase_30 AC 173 ms
89,556 KB
testcase_31 AC 109 ms
82,592 KB
testcase_32 AC 78 ms
77,364 KB
testcase_33 AC 104 ms
85,344 KB
testcase_34 AC 101 ms
80,340 KB
testcase_35 AC 140 ms
87,700 KB
testcase_36 AC 36 ms
52,956 KB
testcase_37 AC 35 ms
52,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
D = []
for i in range(1, N + 1):
    D.append(list(map(int, input().split())))
inf = 10 ** 18
dp = [[-inf, -inf] for i in range(N + 1)]
dp[0][0] = 0
for i in range(N):
    p, a = D[i]
    dp[i + 1][0] = max(dp[i][0] + p, dp[i][1] + 2 * p)
    dp[i + 1][1] = max(dp[i][0] + a, dp[i][1] + 2 * a)

print(max(dp[N]))
0