結果

問題 No.1199 お菓子配り-2
ユーザー googol_S0googol_S0
提出日時 2020-08-28 21:31:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 186 ms / 1,000 ms
コード長 236 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 82,272 KB
実行使用メモリ 76,416 KB
最終ジャッジ日時 2024-04-26 14:22:08
合計ジャッジ時間 9,852 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,584 KB
testcase_01 AC 38 ms
51,712 KB
testcase_02 AC 39 ms
51,968 KB
testcase_03 AC 91 ms
75,392 KB
testcase_04 AC 135 ms
75,648 KB
testcase_05 AC 51 ms
62,464 KB
testcase_06 AC 54 ms
65,920 KB
testcase_07 AC 96 ms
75,392 KB
testcase_08 AC 106 ms
75,520 KB
testcase_09 AC 89 ms
75,136 KB
testcase_10 AC 60 ms
72,448 KB
testcase_11 AC 82 ms
75,392 KB
testcase_12 AC 81 ms
75,008 KB
testcase_13 AC 61 ms
72,960 KB
testcase_14 AC 60 ms
71,040 KB
testcase_15 AC 57 ms
68,224 KB
testcase_16 AC 101 ms
75,520 KB
testcase_17 AC 78 ms
75,008 KB
testcase_18 AC 113 ms
75,648 KB
testcase_19 AC 74 ms
74,880 KB
testcase_20 AC 146 ms
76,160 KB
testcase_21 AC 119 ms
75,648 KB
testcase_22 AC 95 ms
75,392 KB
testcase_23 AC 107 ms
75,392 KB
testcase_24 AC 119 ms
75,392 KB
testcase_25 AC 66 ms
75,136 KB
testcase_26 AC 121 ms
75,264 KB
testcase_27 AC 109 ms
75,520 KB
testcase_28 AC 179 ms
76,160 KB
testcase_29 AC 177 ms
76,160 KB
testcase_30 AC 175 ms
76,032 KB
testcase_31 AC 177 ms
76,160 KB
testcase_32 AC 173 ms
76,416 KB
testcase_33 AC 176 ms
75,904 KB
testcase_34 AC 177 ms
76,416 KB
testcase_35 AC 175 ms
76,032 KB
testcase_36 AC 173 ms
76,160 KB
testcase_37 AC 171 ms
75,904 KB
testcase_38 AC 173 ms
76,288 KB
testcase_39 AC 176 ms
76,288 KB
testcase_40 AC 185 ms
76,288 KB
testcase_41 AC 181 ms
76,032 KB
testcase_42 AC 178 ms
76,416 KB
testcase_43 AC 177 ms
76,160 KB
testcase_44 AC 181 ms
76,416 KB
testcase_45 AC 186 ms
76,416 KB
testcase_46 AC 184 ms
76,416 KB
testcase_47 AC 172 ms
76,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
A=[sum(list(map(int,input().split()))) for i in range(N)]
DP=[[0,0] for i in range(N+1)]
for i in range(N):
  DP[i+1][1]=max(DP[i][1],DP[i][0]+A[i])
  DP[i+1][0]=max(DP[i][0],DP[i][1]-A[i])
print(max(DP[N]))
0