結果

問題 No.1199 お菓子配り-2
ユーザー takakin
提出日時 2020-09-06 20:53:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 502 ms / 1,000 ms
コード長 243 bytes
コンパイル時間 390 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-11-29 07:34:48
合計ジャッジ時間 19,566 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 45
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,m=map(int,input().split())
A=[]
for _ in range(n):
	A.append(sum([int(i) for i in input().split()]))
m1,m2=0,-float("inf")
for a in A:
	m1,m2=max(m1,m2-a),max(m1+a,m2)
print(max(m1,m2))
0