"""
测试用例1
3 3
73 -8 -6 -4
76 -5 -10 -8
80 -6 -15 0
"""
N, M = list(map(int, input().split()))
a = []
b = [0]*N
for i in range(N):
x = list(map(int, input().split()))
t = 0
for j in range(M+1):
if x[j] > 0:
a.append(x[j])
else:
t += x[j]
b[i] = t
T = sum(a) + sum(b)
k = 0
for i in range(1, N):
if abs(b[i]) > abs(b[k]):
k = i
print(T, k+1, abs(b[k]))
为什么是80分?哪里遗漏了欢迎交流!
The Kite Runner。 发布了4 篇原创文章 · 获赞 0 · 访问量 28 私信 关注