結果

問題 No.1160 Strange Bowling
ユーザー yansi819yansi819
提出日時 2024-05-08 09:34:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 354 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 82,648 KB
実行使用メモリ 84,592 KB
最終ジャッジ日時 2024-05-08 09:34:18
合計ジャッジ時間 4,724 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 35 ms
53,512 KB
testcase_02 AC 35 ms
52,352 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 37 ms
52,936 KB
testcase_07 WA -
testcase_08 AC 40 ms
53,560 KB
testcase_09 AC 35 ms
53,252 KB
testcase_10 WA -
testcase_11 AC 93 ms
80,776 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 103 ms
78,120 KB
testcase_15 AC 79 ms
76,736 KB
testcase_16 AC 81 ms
76,728 KB
testcase_17 AC 104 ms
77,884 KB
testcase_18 AC 99 ms
80,896 KB
testcase_19 WA -
testcase_20 AC 104 ms
77,288 KB
testcase_21 WA -
testcase_22 AC 75 ms
76,520 KB
testcase_23 AC 78 ms
77,080 KB
testcase_24 WA -
testcase_25 AC 83 ms
77,096 KB
testcase_26 AC 78 ms
76,648 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 109 ms
78,404 KB
testcase_31 AC 91 ms
77,896 KB
testcase_32 AC 71 ms
76,680 KB
testcase_33 AC 92 ms
77,240 KB
testcase_34 AC 83 ms
77,132 KB
testcase_35 AC 107 ms
78,252 KB
testcase_36 AC 36 ms
52,652 KB
testcase_37 AC 36 ms
53,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

print(dp[N][0])
0