結果

問題 No.1199 お菓子配り-2
ユーザー chineristACchineristAC
提出日時 2020-08-28 22:56:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 206 ms / 1,000 ms
コード長 311 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 77,728 KB
最終ジャッジ日時 2023-08-08 22:54:13
合計ジャッジ時間 11,407 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,224 KB
testcase_01 AC 69 ms
71,328 KB
testcase_02 AC 70 ms
71,196 KB
testcase_03 AC 111 ms
76,264 KB
testcase_04 AC 163 ms
76,924 KB
testcase_05 AC 78 ms
75,640 KB
testcase_06 AC 78 ms
75,500 KB
testcase_07 AC 116 ms
76,208 KB
testcase_08 AC 131 ms
76,384 KB
testcase_09 AC 110 ms
76,284 KB
testcase_10 AC 86 ms
76,060 KB
testcase_11 AC 103 ms
76,228 KB
testcase_12 AC 101 ms
76,428 KB
testcase_13 AC 85 ms
76,204 KB
testcase_14 AC 85 ms
75,636 KB
testcase_15 AC 82 ms
75,552 KB
testcase_16 AC 126 ms
76,328 KB
testcase_17 AC 106 ms
76,460 KB
testcase_18 AC 137 ms
76,740 KB
testcase_19 AC 96 ms
76,404 KB
testcase_20 AC 170 ms
77,180 KB
testcase_21 AC 144 ms
76,720 KB
testcase_22 AC 118 ms
76,556 KB
testcase_23 AC 130 ms
77,096 KB
testcase_24 AC 145 ms
76,708 KB
testcase_25 AC 86 ms
76,232 KB
testcase_26 AC 145 ms
76,500 KB
testcase_27 AC 130 ms
76,372 KB
testcase_28 AC 201 ms
77,188 KB
testcase_29 AC 199 ms
77,336 KB
testcase_30 AC 202 ms
77,364 KB
testcase_31 AC 201 ms
77,288 KB
testcase_32 AC 202 ms
77,468 KB
testcase_33 AC 206 ms
77,460 KB
testcase_34 AC 200 ms
77,728 KB
testcase_35 AC 197 ms
77,536 KB
testcase_36 AC 201 ms
77,564 KB
testcase_37 AC 201 ms
77,456 KB
testcase_38 AC 203 ms
77,292 KB
testcase_39 AC 200 ms
77,552 KB
testcase_40 AC 199 ms
77,332 KB
testcase_41 AC 204 ms
77,516 KB
testcase_42 AC 203 ms
77,212 KB
testcase_43 AC 203 ms
77,296 KB
testcase_44 AC 202 ms
77,660 KB
testcase_45 AC 200 ms
77,212 KB
testcase_46 AC 199 ms
77,284 KB
testcase_47 AC 199 ms
77,604 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