結果

問題 No.1199 お菓子配り-2
ユーザー mlihua09mlihua09
提出日時 2020-08-28 21:37:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 1,000 ms
コード長 212 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 76,288 KB
最終ジャッジ日時 2024-04-26 14:28:21
合計ジャッジ時間 9,515 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,136 KB
testcase_01 AC 38 ms
51,756 KB
testcase_02 AC 37 ms
53,024 KB
testcase_03 AC 76 ms
75,376 KB
testcase_04 AC 114 ms
75,228 KB
testcase_05 AC 42 ms
61,300 KB
testcase_06 AC 45 ms
64,032 KB
testcase_07 AC 79 ms
75,068 KB
testcase_08 AC 89 ms
75,136 KB
testcase_09 AC 73 ms
75,008 KB
testcase_10 AC 49 ms
68,992 KB
testcase_11 AC 68 ms
75,136 KB
testcase_12 AC 66 ms
74,960 KB
testcase_13 AC 48 ms
68,608 KB
testcase_14 AC 50 ms
67,328 KB
testcase_15 AC 47 ms
65,152 KB
testcase_16 AC 90 ms
75,424 KB
testcase_17 AC 70 ms
75,012 KB
testcase_18 AC 98 ms
75,136 KB
testcase_19 AC 64 ms
75,008 KB
testcase_20 AC 130 ms
76,048 KB
testcase_21 AC 105 ms
75,836 KB
testcase_22 AC 86 ms
75,776 KB
testcase_23 AC 91 ms
75,008 KB
testcase_24 AC 102 ms
75,136 KB
testcase_25 AC 51 ms
70,016 KB
testcase_26 AC 105 ms
75,392 KB
testcase_27 AC 94 ms
74,880 KB
testcase_28 AC 156 ms
75,916 KB
testcase_29 AC 157 ms
75,648 KB
testcase_30 AC 151 ms
75,992 KB
testcase_31 AC 152 ms
75,976 KB
testcase_32 AC 152 ms
75,648 KB
testcase_33 AC 151 ms
75,780 KB
testcase_34 AC 150 ms
76,220 KB
testcase_35 AC 149 ms
76,288 KB
testcase_36 AC 150 ms
75,548 KB
testcase_37 AC 154 ms
75,400 KB
testcase_38 AC 152 ms
75,904 KB
testcase_39 AC 154 ms
75,608 KB
testcase_40 AC 150 ms
76,012 KB
testcase_41 AC 153 ms
75,620 KB
testcase_42 AC 156 ms
75,648 KB
testcase_43 AC 154 ms
76,164 KB
testcase_44 AC 151 ms
75,872 KB
testcase_45 AC 153 ms
75,648 KB
testcase_46 AC 150 ms
75,972 KB
testcase_47 AC 150 ms
75,392 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