結果

問題 No.1160 Strange Bowling
ユーザー first_vilfirst_vil
提出日時 2020-08-17 21:38:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,388 KB
実行使用メモリ 76,112 KB
最終ジャッジ日時 2024-04-19 19:07:22
合計ジャッジ時間 3,580 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,840 KB
testcase_01 AC 33 ms
52,096 KB
testcase_02 AC 32 ms
51,968 KB
testcase_03 AC 31 ms
52,096 KB
testcase_04 AC 30 ms
51,968 KB
testcase_05 AC 31 ms
51,968 KB
testcase_06 AC 31 ms
51,712 KB
testcase_07 AC 31 ms
52,480 KB
testcase_08 AC 32 ms
51,840 KB
testcase_09 AC 30 ms
52,352 KB
testcase_10 AC 68 ms
76,048 KB
testcase_11 AC 61 ms
75,720 KB
testcase_12 AC 51 ms
71,680 KB
testcase_13 AC 50 ms
67,328 KB
testcase_14 AC 63 ms
75,756 KB
testcase_15 AC 50 ms
69,504 KB
testcase_16 AC 51 ms
72,064 KB
testcase_17 AC 60 ms
75,648 KB
testcase_18 AC 59 ms
76,112 KB
testcase_19 AC 55 ms
75,648 KB
testcase_20 AC 59 ms
75,708 KB
testcase_21 AC 58 ms
75,556 KB
testcase_22 AC 48 ms
68,480 KB
testcase_23 AC 49 ms
69,120 KB
testcase_24 AC 50 ms
68,352 KB
testcase_25 AC 62 ms
75,824 KB
testcase_26 AC 51 ms
69,760 KB
testcase_27 AC 58 ms
75,904 KB
testcase_28 AC 51 ms
71,424 KB
testcase_29 AC 63 ms
76,028 KB
testcase_30 AC 63 ms
75,864 KB
testcase_31 AC 55 ms
75,824 KB
testcase_32 AC 45 ms
67,584 KB
testcase_33 AC 53 ms
75,776 KB
testcase_34 AC 50 ms
75,328 KB
testcase_35 AC 62 ms
75,392 KB
testcase_36 AC 32 ms
51,840 KB
testcase_37 AC 32 ms
51,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input=sys.stdin.readline
    n=int(input())
    dp=[[0,-10**10],[0,0]]
    for i in range(n):
        p,a=map(int,input().split())
        dp[(i+1)&1][0]=max(dp[i&1][0]+p,dp[i&1][1]+p*2)
        dp[(i+1)&1][1]=max(dp[i&1][0]+a,dp[i&1][1]+a*2)
    print(max(dp[n&1]))
main()
0