結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,968 KB
testcase_01 AC 36 ms
51,712 KB
testcase_02 AC 37 ms
51,712 KB
testcase_03 AC 75 ms
75,008 KB
testcase_04 AC 116 ms
75,760 KB
testcase_05 AC 45 ms
60,800 KB
testcase_06 AC 46 ms
63,488 KB
testcase_07 AC 82 ms
74,876 KB
testcase_08 AC 89 ms
75,012 KB
testcase_09 AC 75 ms
74,880 KB
testcase_10 AC 50 ms
68,864 KB
testcase_11 AC 67 ms
75,384 KB
testcase_12 AC 67 ms
75,392 KB
testcase_13 AC 48 ms
68,736 KB
testcase_14 AC 50 ms
67,456 KB
testcase_15 AC 48 ms
65,920 KB
testcase_16 AC 90 ms
75,504 KB
testcase_17 AC 71 ms
75,304 KB
testcase_18 AC 97 ms
75,600 KB
testcase_19 AC 63 ms
75,352 KB
testcase_20 AC 134 ms
75,648 KB
testcase_21 AC 104 ms
75,956 KB
testcase_22 AC 80 ms
75,240 KB
testcase_23 AC 91 ms
75,204 KB
testcase_24 AC 101 ms
75,632 KB
testcase_25 AC 51 ms
69,888 KB
testcase_26 AC 103 ms
75,008 KB
testcase_27 AC 93 ms
75,520 KB
testcase_28 AC 150 ms
75,424 KB
testcase_29 AC 154 ms
75,776 KB
testcase_30 AC 158 ms
75,904 KB
testcase_31 AC 151 ms
75,968 KB
testcase_32 AC 151 ms
76,160 KB
testcase_33 AC 153 ms
75,924 KB
testcase_34 AC 150 ms
76,536 KB
testcase_35 AC 154 ms
75,776 KB
testcase_36 AC 150 ms
76,032 KB
testcase_37 AC 155 ms
75,904 KB
testcase_38 AC 154 ms
75,548 KB
testcase_39 AC 153 ms
76,032 KB
testcase_40 AC 151 ms
76,032 KB
testcase_41 AC 155 ms
76,160 KB
testcase_42 AC 155 ms
75,776 KB
testcase_43 AC 146 ms
75,808 KB
testcase_44 AC 150 ms
76,032 KB
testcase_45 AC 158 ms
75,900 KB
testcase_46 AC 153 ms
75,904 KB
testcase_47 AC 165 ms
75,788 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