結果

問題 No.1199 お菓子配り-2
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-08-28 21:48:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 182 ms / 1,000 ms
コード長 337 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 77,520 KB
最終ジャッジ日時 2023-08-08 22:31:28
合計ジャッジ時間 10,725 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,348 KB
testcase_01 AC 66 ms
71,440 KB
testcase_02 AC 66 ms
71,264 KB
testcase_03 AC 100 ms
76,260 KB
testcase_04 AC 147 ms
76,412 KB
testcase_05 AC 71 ms
75,760 KB
testcase_06 AC 75 ms
75,616 KB
testcase_07 AC 104 ms
76,388 KB
testcase_08 AC 114 ms
76,432 KB
testcase_09 AC 100 ms
76,340 KB
testcase_10 AC 78 ms
75,600 KB
testcase_11 AC 94 ms
76,228 KB
testcase_12 AC 94 ms
76,236 KB
testcase_13 AC 81 ms
76,132 KB
testcase_14 AC 79 ms
75,764 KB
testcase_15 AC 76 ms
75,640 KB
testcase_16 AC 119 ms
76,352 KB
testcase_17 AC 94 ms
76,216 KB
testcase_18 AC 122 ms
76,276 KB
testcase_19 AC 87 ms
76,284 KB
testcase_20 AC 155 ms
77,160 KB
testcase_21 AC 129 ms
76,756 KB
testcase_22 AC 103 ms
76,268 KB
testcase_23 AC 120 ms
76,388 KB
testcase_24 AC 130 ms
76,428 KB
testcase_25 AC 80 ms
76,352 KB
testcase_26 AC 130 ms
76,456 KB
testcase_27 AC 118 ms
76,388 KB
testcase_28 AC 182 ms
77,372 KB
testcase_29 AC 182 ms
77,268 KB
testcase_30 AC 178 ms
77,084 KB
testcase_31 AC 175 ms
77,352 KB
testcase_32 AC 173 ms
77,208 KB
testcase_33 AC 172 ms
77,176 KB
testcase_34 AC 172 ms
77,404 KB
testcase_35 AC 174 ms
77,272 KB
testcase_36 AC 181 ms
77,368 KB
testcase_37 AC 176 ms
77,392 KB
testcase_38 AC 171 ms
77,036 KB
testcase_39 AC 172 ms
77,284 KB
testcase_40 AC 168 ms
77,368 KB
testcase_41 AC 167 ms
77,196 KB
testcase_42 AC 172 ms
77,028 KB
testcase_43 AC 176 ms
77,408 KB
testcase_44 AC 175 ms
77,520 KB
testcase_45 AC 171 ms
77,516 KB
testcase_46 AC 171 ms
77,232 KB
testcase_47 AC 169 ms
77,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

N,M = map(int,stdin.readline().split())

A = []

for i in range(N):

    a = sum( list(map(int,stdin.readline().split())) )
    A.append(a)

dp = [0,0]

for i in range(N):

    ndp = [float("-inf"),float("-inf")]
    ndp[0] = max(dp[0],dp[1]-A[i])
    ndp[1] = max(dp[1],dp[0]+A[i])

    dp = ndp

print (max(dp))
0