結果

問題 No.1199 お菓子配り-2
ユーザー 👑 KazunKazun
提出日時 2020-08-28 21:42:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 175 ms / 1,000 ms
コード長 276 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 76,912 KB
最終ジャッジ日時 2024-04-26 14:35:45
合計ジャッジ時間 9,835 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,340 KB
testcase_01 AC 38 ms
53,248 KB
testcase_02 AC 37 ms
52,804 KB
testcase_03 AC 82 ms
75,364 KB
testcase_04 AC 134 ms
76,132 KB
testcase_05 AC 44 ms
63,780 KB
testcase_06 AC 47 ms
66,556 KB
testcase_07 AC 87 ms
75,592 KB
testcase_08 AC 100 ms
75,516 KB
testcase_09 AC 78 ms
75,304 KB
testcase_10 AC 54 ms
72,716 KB
testcase_11 AC 74 ms
75,156 KB
testcase_12 AC 73 ms
75,412 KB
testcase_13 AC 51 ms
73,488 KB
testcase_14 AC 52 ms
71,796 KB
testcase_15 AC 49 ms
69,316 KB
testcase_16 AC 96 ms
75,644 KB
testcase_17 AC 74 ms
75,304 KB
testcase_18 AC 106 ms
75,428 KB
testcase_19 AC 65 ms
75,168 KB
testcase_20 AC 141 ms
75,952 KB
testcase_21 AC 112 ms
75,424 KB
testcase_22 AC 87 ms
75,764 KB
testcase_23 AC 98 ms
75,792 KB
testcase_24 AC 110 ms
75,548 KB
testcase_25 AC 58 ms
75,108 KB
testcase_26 AC 115 ms
75,540 KB
testcase_27 AC 101 ms
75,352 KB
testcase_28 AC 171 ms
76,484 KB
testcase_29 AC 161 ms
76,240 KB
testcase_30 AC 161 ms
76,912 KB
testcase_31 AC 159 ms
76,416 KB
testcase_32 AC 158 ms
76,312 KB
testcase_33 AC 160 ms
76,664 KB
testcase_34 AC 164 ms
76,400 KB
testcase_35 AC 166 ms
76,468 KB
testcase_36 AC 160 ms
76,348 KB
testcase_37 AC 167 ms
76,516 KB
testcase_38 AC 171 ms
76,840 KB
testcase_39 AC 168 ms
76,372 KB
testcase_40 AC 169 ms
76,660 KB
testcase_41 AC 175 ms
76,648 KB
testcase_42 AC 170 ms
76,056 KB
testcase_43 AC 171 ms
76,192 KB
testcase_44 AC 170 ms
76,108 KB
testcase_45 AC 168 ms
76,132 KB
testcase_46 AC 168 ms
76,552 KB
testcase_47 AC 168 ms
76,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

DP=[[0,0] for _ in range(N+1)]

for x in range(1,N+1):
    DP[x][0]=max(DP[x-1][0],DP[x-1][1]+B[x-1])
    DP[x][1]=max(DP[x-1][0]-B[x-1],DP[x-1][1])

print(DP[-1][0])
0