結果

問題 No.1160 Strange Bowling
ユーザー pluto77pluto77
提出日時 2022-02-18 11:23:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 467 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 44,080 KB
最終ジャッジ日時 2023-09-11 18:06:21
合計ジャッジ時間 8,132 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,848 KB
testcase_01 AC 16 ms
7,860 KB
testcase_02 AC 15 ms
7,996 KB
testcase_03 AC 16 ms
7,812 KB
testcase_04 AC 16 ms
7,792 KB
testcase_05 AC 15 ms
7,856 KB
testcase_06 AC 15 ms
7,892 KB
testcase_07 AC 15 ms
8,004 KB
testcase_08 AC 15 ms
7,852 KB
testcase_09 AC 15 ms
7,864 KB
testcase_10 AC 338 ms
33,216 KB
testcase_11 AC 186 ms
21,716 KB
testcase_12 AC 97 ms
14,600 KB
testcase_13 AC 56 ms
11,168 KB
testcase_14 AC 307 ms
30,972 KB
testcase_15 AC 81 ms
13,284 KB
testcase_16 AC 96 ms
14,756 KB
testcase_17 AC 287 ms
29,072 KB
testcase_18 AC 195 ms
22,684 KB
testcase_19 AC 136 ms
17,692 KB
testcase_20 AC 246 ms
25,908 KB
testcase_21 AC 185 ms
21,884 KB
testcase_22 AC 69 ms
12,168 KB
testcase_23 AC 69 ms
12,144 KB
testcase_24 AC 65 ms
11,828 KB
testcase_25 AC 147 ms
18,636 KB
testcase_26 AC 80 ms
13,160 KB
testcase_27 AC 218 ms
23,824 KB
testcase_28 AC 87 ms
13,828 KB
testcase_29 AC 304 ms
30,600 KB
testcase_30 AC 467 ms
44,080 KB
testcase_31 AC 261 ms
27,304 KB
testcase_32 AC 83 ms
13,756 KB
testcase_33 AC 182 ms
21,416 KB
testcase_34 AC 174 ms
20,956 KB
testcase_35 AC 414 ms
38,648 KB
testcase_36 AC 15 ms
7,860 KB
testcase_37 AC 15 ms
7,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1160
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
dp=[[0]*2 for i in range(n+1)]
dp[0][0]=-float('inf')
for i,(x,y) in enumerate(l):
 dp[i+1][0]=max(dp[i][0]+2*y,dp[i][1]+y)
 dp[i+1][1]=max(dp[i][0]+2*x,dp[i][1]+x)
print(max(dp[-1]))
0