結果

問題 No.1199 お菓子配り-2
ユーザー komkompikomkompi
提出日時 2020-10-23 08:08:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 241 ms / 1,000 ms
コード長 260 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 10,512 KB
実行使用メモリ 8,540 KB
最終ジャッジ日時 2023-09-28 15:05:21
合計ジャッジ時間 14,364 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,748 KB
testcase_01 AC 16 ms
7,804 KB
testcase_02 AC 16 ms
7,900 KB
testcase_03 AC 73 ms
8,344 KB
testcase_04 AC 158 ms
8,396 KB
testcase_05 AC 21 ms
8,224 KB
testcase_06 AC 24 ms
8,172 KB
testcase_07 AC 84 ms
8,324 KB
testcase_08 AC 109 ms
8,344 KB
testcase_09 AC 72 ms
8,304 KB
testcase_10 AC 30 ms
8,200 KB
testcase_11 AC 59 ms
8,216 KB
testcase_12 AC 58 ms
8,456 KB
testcase_13 AC 30 ms
8,220 KB
testcase_14 AC 29 ms
8,108 KB
testcase_15 AC 26 ms
8,108 KB
testcase_16 AC 106 ms
8,352 KB
testcase_17 AC 61 ms
8,276 KB
testcase_18 AC 114 ms
8,140 KB
testcase_19 AC 42 ms
8,248 KB
testcase_20 AC 185 ms
8,408 KB
testcase_21 AC 123 ms
8,200 KB
testcase_22 AC 74 ms
8,260 KB
testcase_23 AC 98 ms
8,216 KB
testcase_24 AC 126 ms
8,296 KB
testcase_25 AC 32 ms
8,188 KB
testcase_26 AC 137 ms
8,352 KB
testcase_27 AC 113 ms
8,400 KB
testcase_28 AC 238 ms
8,504 KB
testcase_29 AC 241 ms
8,492 KB
testcase_30 AC 239 ms
8,432 KB
testcase_31 AC 238 ms
8,496 KB
testcase_32 AC 238 ms
8,464 KB
testcase_33 AC 238 ms
8,456 KB
testcase_34 AC 239 ms
8,388 KB
testcase_35 AC 238 ms
8,384 KB
testcase_36 AC 241 ms
8,496 KB
testcase_37 AC 239 ms
8,488 KB
testcase_38 AC 238 ms
8,516 KB
testcase_39 AC 240 ms
8,456 KB
testcase_40 AC 238 ms
8,412 KB
testcase_41 AC 239 ms
8,244 KB
testcase_42 AC 237 ms
8,436 KB
testcase_43 AC 238 ms
8,540 KB
testcase_44 AC 238 ms
8,360 KB
testcase_45 AC 240 ms
8,388 KB
testcase_46 AC 237 ms
8,396 KB
testcase_47 AC 238 ms
8,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
N,M=map(int,input().split())
A=[]
for i in range(N):
    temp=list(map(int,input().split()))
    A.append(sum(temp))

dp=[0,0]

for a in A:
    dp[0],dp[1]=max(dp[1]-a,dp[0]),max(dp[0]+a,dp[1])
    
#print(A)
print(max(dp))


0