結果

問題 No.1199 お菓子配り-2
ユーザー mlihua09mlihua09
提出日時 2020-08-28 21:37:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 190 ms / 1,000 ms
コード長 212 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 77,284 KB
最終ジャッジ日時 2023-08-08 22:19:24
合計ジャッジ時間 11,244 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,412 KB
testcase_01 AC 70 ms
71,420 KB
testcase_02 AC 73 ms
71,272 KB
testcase_03 AC 110 ms
76,272 KB
testcase_04 AC 151 ms
76,832 KB
testcase_05 AC 76 ms
75,584 KB
testcase_06 AC 79 ms
75,532 KB
testcase_07 AC 112 ms
76,160 KB
testcase_08 AC 121 ms
76,240 KB
testcase_09 AC 107 ms
76,244 KB
testcase_10 AC 83 ms
75,812 KB
testcase_11 AC 101 ms
76,052 KB
testcase_12 AC 99 ms
76,116 KB
testcase_13 AC 83 ms
75,388 KB
testcase_14 AC 84 ms
75,556 KB
testcase_15 AC 81 ms
75,384 KB
testcase_16 AC 121 ms
76,172 KB
testcase_17 AC 101 ms
75,992 KB
testcase_18 AC 130 ms
76,556 KB
testcase_19 AC 95 ms
76,056 KB
testcase_20 AC 165 ms
76,736 KB
testcase_21 AC 135 ms
76,720 KB
testcase_22 AC 113 ms
76,620 KB
testcase_23 AC 124 ms
76,400 KB
testcase_24 AC 134 ms
76,600 KB
testcase_25 AC 85 ms
75,484 KB
testcase_26 AC 137 ms
76,200 KB
testcase_27 AC 126 ms
76,372 KB
testcase_28 AC 190 ms
77,140 KB
testcase_29 AC 190 ms
77,284 KB
testcase_30 AC 189 ms
77,232 KB
testcase_31 AC 187 ms
77,272 KB
testcase_32 AC 188 ms
77,092 KB
testcase_33 AC 189 ms
77,224 KB
testcase_34 AC 186 ms
76,908 KB
testcase_35 AC 187 ms
76,928 KB
testcase_36 AC 186 ms
76,924 KB
testcase_37 AC 187 ms
77,128 KB
testcase_38 AC 189 ms
76,920 KB
testcase_39 AC 190 ms
77,124 KB
testcase_40 AC 188 ms
77,112 KB
testcase_41 AC 187 ms
76,792 KB
testcase_42 AC 188 ms
77,176 KB
testcase_43 AC 188 ms
77,152 KB
testcase_44 AC 187 ms
77,148 KB
testcase_45 AC 187 ms
77,200 KB
testcase_46 AC 189 ms
77,068 KB
testcase_47 AC 187 ms
77,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #




N, M = map(int, input().split())

dp1 = 0

A = [sum(map(int, input().split())) for i in range(N)]


dp2 = A[0]



for i in A:
    
    dp1, dp2 = max(dp1, dp2 - i), max(dp2, dp1 + i)
    
print(max(dp1, dp2))
0