結果

問題 No.1199 お菓子配り-2
ユーザー KudeKude
提出日時 2020-08-28 21:43:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 178 ms / 1,000 ms
コード長 204 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 77,560 KB
最終ジャッジ日時 2023-08-08 22:28:04
合計ジャッジ時間 10,382 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,332 KB
testcase_01 AC 65 ms
71,488 KB
testcase_02 AC 65 ms
71,360 KB
testcase_03 AC 102 ms
76,308 KB
testcase_04 AC 134 ms
76,788 KB
testcase_05 AC 71 ms
75,480 KB
testcase_06 AC 73 ms
75,732 KB
testcase_07 AC 101 ms
76,240 KB
testcase_08 AC 111 ms
76,360 KB
testcase_09 AC 94 ms
76,216 KB
testcase_10 AC 72 ms
75,568 KB
testcase_11 AC 86 ms
76,412 KB
testcase_12 AC 87 ms
76,136 KB
testcase_13 AC 74 ms
75,692 KB
testcase_14 AC 74 ms
75,608 KB
testcase_15 AC 75 ms
75,688 KB
testcase_16 AC 109 ms
76,320 KB
testcase_17 AC 90 ms
76,208 KB
testcase_18 AC 120 ms
76,532 KB
testcase_19 AC 84 ms
76,052 KB
testcase_20 AC 140 ms
77,020 KB
testcase_21 AC 115 ms
76,772 KB
testcase_22 AC 99 ms
76,628 KB
testcase_23 AC 111 ms
76,560 KB
testcase_24 AC 117 ms
76,412 KB
testcase_25 AC 76 ms
75,460 KB
testcase_26 AC 118 ms
76,376 KB
testcase_27 AC 107 ms
76,348 KB
testcase_28 AC 165 ms
77,292 KB
testcase_29 AC 155 ms
77,020 KB
testcase_30 AC 158 ms
77,260 KB
testcase_31 AC 156 ms
77,136 KB
testcase_32 AC 155 ms
77,180 KB
testcase_33 AC 167 ms
77,200 KB
testcase_34 AC 157 ms
77,296 KB
testcase_35 AC 158 ms
77,248 KB
testcase_36 AC 164 ms
77,560 KB
testcase_37 AC 160 ms
77,292 KB
testcase_38 AC 158 ms
77,280 KB
testcase_39 AC 168 ms
77,084 KB
testcase_40 AC 170 ms
77,272 KB
testcase_41 AC 170 ms
77,472 KB
testcase_42 AC 169 ms
77,348 KB
testcase_43 AC 175 ms
77,072 KB
testcase_44 AC 165 ms
77,516 KB
testcase_45 AC 167 ms
77,204 KB
testcase_46 AC 170 ms
77,128 KB
testcase_47 AC 178 ms
77,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
a = [sum(map(int, input().split())) for _ in range(n)]
dp = [0, 0]
for x in a:
    dp = [
        max(dp[0], dp[1] - x),
        max(dp[1], dp[0] + x)
    ]
print(max(dp))
0