結果

問題 No.1199 お菓子配り-2
ユーザー chineristACchineristAC
提出日時 2020-08-28 22:56:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 1,000 ms
コード長 311 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 82,040 KB
実行使用メモリ 76,784 KB
最終ジャッジ日時 2024-04-26 15:04:58
合計ジャッジ時間 9,156 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,460 KB
testcase_01 AC 36 ms
52,552 KB
testcase_02 AC 35 ms
53,124 KB
testcase_03 AC 78 ms
75,252 KB
testcase_04 AC 119 ms
75,544 KB
testcase_05 AC 42 ms
63,220 KB
testcase_06 AC 46 ms
66,692 KB
testcase_07 AC 82 ms
75,044 KB
testcase_08 AC 91 ms
75,212 KB
testcase_09 AC 74 ms
75,440 KB
testcase_10 AC 51 ms
73,248 KB
testcase_11 AC 68 ms
75,188 KB
testcase_12 AC 68 ms
75,452 KB
testcase_13 AC 50 ms
73,884 KB
testcase_14 AC 51 ms
71,992 KB
testcase_15 AC 49 ms
70,352 KB
testcase_16 AC 91 ms
75,360 KB
testcase_17 AC 72 ms
75,316 KB
testcase_18 AC 102 ms
75,860 KB
testcase_19 AC 62 ms
75,064 KB
testcase_20 AC 130 ms
75,836 KB
testcase_21 AC 105 ms
75,752 KB
testcase_22 AC 85 ms
75,716 KB
testcase_23 AC 94 ms
75,304 KB
testcase_24 AC 107 ms
75,368 KB
testcase_25 AC 55 ms
75,192 KB
testcase_26 AC 108 ms
75,164 KB
testcase_27 AC 94 ms
75,172 KB
testcase_28 AC 155 ms
75,944 KB
testcase_29 AC 155 ms
76,508 KB
testcase_30 AC 158 ms
76,208 KB
testcase_31 AC 152 ms
76,492 KB
testcase_32 AC 154 ms
75,936 KB
testcase_33 AC 154 ms
76,132 KB
testcase_34 AC 153 ms
76,208 KB
testcase_35 AC 149 ms
76,056 KB
testcase_36 AC 159 ms
76,784 KB
testcase_37 AC 157 ms
76,208 KB
testcase_38 AC 154 ms
76,052 KB
testcase_39 AC 155 ms
76,352 KB
testcase_40 AC 154 ms
76,072 KB
testcase_41 AC 155 ms
76,088 KB
testcase_42 AC 163 ms
76,504 KB
testcase_43 AC 156 ms
76,128 KB
testcase_44 AC 159 ms
76,588 KB
testcase_45 AC 150 ms
75,884 KB
testcase_46 AC 157 ms
76,068 KB
testcase_47 AC 150 ms
76,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
A = [sum(list(map(int,input().split()))) for i in range(N)]

dpMax=[0 for i in range(N)]
dpMin=[0 for i in range(N)]
dpMax[-1]=A[-1]
dpMin[-1]=0

for i in range(N-2,-1,-1):
    dpMax[i]=max(dpMax[i+1],A[i]-dpMin[i+1])
    dpMin[i]=min(dpMin[i+1],A[i]-dpMax[i+1])

print(dpMax[0])
0