結果

問題 No.1199 お菓子配り-2
ユーザー marroncastlemarroncastle
提出日時 2020-08-28 21:42:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 299 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 80,508 KB
最終ジャッジ日時 2024-04-26 14:35:01
合計ジャッジ時間 37,776 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 528 ms
44,444 KB
testcase_01 AC 515 ms
43,800 KB
testcase_02 AC 512 ms
44,440 KB
testcase_03 AC 586 ms
44,184 KB
testcase_04 AC 696 ms
44,320 KB
testcase_05 WA -
testcase_06 AC 524 ms
43,936 KB
testcase_07 WA -
testcase_08 AC 634 ms
44,060 KB
testcase_09 WA -
testcase_10 AC 531 ms
44,308 KB
testcase_11 AC 571 ms
43,928 KB
testcase_12 AC 574 ms
43,804 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 528 ms
44,320 KB
testcase_16 AC 625 ms
44,332 KB
testcase_17 AC 571 ms
43,936 KB
testcase_18 AC 641 ms
43,932 KB
testcase_19 AC 544 ms
44,444 KB
testcase_20 AC 711 ms
44,064 KB
testcase_21 AC 645 ms
44,316 KB
testcase_22 AC 592 ms
44,184 KB
testcase_23 WA -
testcase_24 AC 661 ms
43,932 KB
testcase_25 AC 549 ms
43,800 KB
testcase_26 AC 671 ms
44,440 KB
testcase_27 AC 649 ms
44,304 KB
testcase_28 AC 797 ms
44,312 KB
testcase_29 WA -
testcase_30 AC 795 ms
44,440 KB
testcase_31 AC 785 ms
43,936 KB
testcase_32 AC 787 ms
43,808 KB
testcase_33 AC 784 ms
44,316 KB
testcase_34 AC 793 ms
44,192 KB
testcase_35 AC 792 ms
43,932 KB
testcase_36 AC 790 ms
44,448 KB
testcase_37 AC 801 ms
43,928 KB
testcase_38 AC 797 ms
44,060 KB
testcase_39 AC 792 ms
43,928 KB
testcase_40 WA -
testcase_41 AC 795 ms
44,060 KB
testcase_42 AC 788 ms
44,312 KB
testcase_43 AC 796 ms
44,316 KB
testcase_44 WA -
testcase_45 AC 790 ms
44,308 KB
testcase_46 WA -
testcase_47 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
N, M = map(int, input().split())
A = [sum(map(int, input().split())) for _ in range(N)]
dp1 = A[:]
dp2 = [0]*N
if N>1:
  dp2[1] = dp1[0]-A[1]
for i in range(2,N):
  dp1[i] = max([dp1[i],dp1[i-1],dp2[i-1]+A[i]])
  dp2[i] = max(dp1[i-1]-A[i],dp2[i-1])
print(max(dp1[-1],dp2[-1]))


0