結果

問題 No.1199 お菓子配り-2
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-08-28 21:48:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 155 ms / 1,000 ms
コード長 337 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 82,044 KB
実行使用メモリ 76,364 KB
最終ジャッジ日時 2024-04-26 14:40:46
合計ジャッジ時間 8,727 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,164 KB
testcase_01 AC 34 ms
52,340 KB
testcase_02 AC 33 ms
52,276 KB
testcase_03 AC 69 ms
75,244 KB
testcase_04 AC 105 ms
75,100 KB
testcase_05 AC 40 ms
63,652 KB
testcase_06 AC 45 ms
65,996 KB
testcase_07 AC 72 ms
75,768 KB
testcase_08 AC 83 ms
75,144 KB
testcase_09 AC 71 ms
75,108 KB
testcase_10 AC 49 ms
72,292 KB
testcase_11 AC 63 ms
75,148 KB
testcase_12 AC 63 ms
75,352 KB
testcase_13 AC 48 ms
73,372 KB
testcase_14 AC 49 ms
70,680 KB
testcase_15 AC 46 ms
69,284 KB
testcase_16 AC 84 ms
75,104 KB
testcase_17 AC 67 ms
75,080 KB
testcase_18 AC 86 ms
75,168 KB
testcase_19 AC 58 ms
75,036 KB
testcase_20 AC 113 ms
75,352 KB
testcase_21 AC 91 ms
75,404 KB
testcase_22 AC 73 ms
75,248 KB
testcase_23 AC 83 ms
74,900 KB
testcase_24 AC 92 ms
75,164 KB
testcase_25 AC 49 ms
73,180 KB
testcase_26 AC 97 ms
75,296 KB
testcase_27 AC 86 ms
75,372 KB
testcase_28 AC 152 ms
75,880 KB
testcase_29 AC 155 ms
75,996 KB
testcase_30 AC 141 ms
76,244 KB
testcase_31 AC 138 ms
76,048 KB
testcase_32 AC 141 ms
76,324 KB
testcase_33 AC 142 ms
76,172 KB
testcase_34 AC 140 ms
75,992 KB
testcase_35 AC 139 ms
76,116 KB
testcase_36 AC 139 ms
75,856 KB
testcase_37 AC 142 ms
76,056 KB
testcase_38 AC 147 ms
76,284 KB
testcase_39 AC 140 ms
76,272 KB
testcase_40 AC 144 ms
76,364 KB
testcase_41 AC 144 ms
75,936 KB
testcase_42 AC 137 ms
75,988 KB
testcase_43 AC 141 ms
76,344 KB
testcase_44 AC 138 ms
76,360 KB
testcase_45 AC 139 ms
75,964 KB
testcase_46 AC 146 ms
76,196 KB
testcase_47 AC 145 ms
76,076 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