結果

問題 No.1199 お菓子配り-2
ユーザー 👑 timitimi
提出日時 2021-02-05 10:25:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 244 ms / 1,000 ms
コード長 234 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 8,580 KB
最終ジャッジ日時 2023-09-14 16:08:22
合計ジャッジ時間 11,069 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,712 KB
testcase_01 AC 15 ms
7,840 KB
testcase_02 AC 15 ms
7,848 KB
testcase_03 AC 75 ms
8,380 KB
testcase_04 AC 159 ms
8,268 KB
testcase_05 AC 20 ms
8,316 KB
testcase_06 AC 24 ms
8,236 KB
testcase_07 AC 84 ms
8,356 KB
testcase_08 AC 108 ms
8,320 KB
testcase_09 AC 72 ms
8,208 KB
testcase_10 AC 30 ms
8,212 KB
testcase_11 AC 60 ms
8,344 KB
testcase_12 AC 59 ms
8,404 KB
testcase_13 AC 30 ms
8,412 KB
testcase_14 AC 29 ms
8,272 KB
testcase_15 AC 27 ms
8,288 KB
testcase_16 AC 107 ms
8,540 KB
testcase_17 AC 62 ms
8,256 KB
testcase_18 AC 114 ms
8,376 KB
testcase_19 AC 42 ms
8,284 KB
testcase_20 AC 187 ms
8,384 KB
testcase_21 AC 123 ms
8,216 KB
testcase_22 AC 74 ms
8,216 KB
testcase_23 AC 97 ms
8,136 KB
testcase_24 AC 127 ms
8,432 KB
testcase_25 AC 33 ms
8,340 KB
testcase_26 AC 137 ms
8,540 KB
testcase_27 AC 115 ms
8,412 KB
testcase_28 AC 240 ms
8,556 KB
testcase_29 AC 240 ms
8,356 KB
testcase_30 AC 240 ms
8,536 KB
testcase_31 AC 238 ms
8,480 KB
testcase_32 AC 239 ms
8,516 KB
testcase_33 AC 239 ms
8,568 KB
testcase_34 AC 240 ms
8,416 KB
testcase_35 AC 240 ms
8,488 KB
testcase_36 AC 244 ms
8,452 KB
testcase_37 AC 240 ms
8,492 KB
testcase_38 AC 241 ms
8,488 KB
testcase_39 AC 240 ms
8,424 KB
testcase_40 AC 240 ms
8,384 KB
testcase_41 AC 241 ms
8,480 KB
testcase_42 AC 241 ms
8,536 KB
testcase_43 AC 239 ms
8,568 KB
testcase_44 AC 240 ms
8,580 KB
testcase_45 AC 241 ms
8,468 KB
testcase_46 AC 240 ms
8,416 KB
testcase_47 AC 239 ms
8,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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