
种苹果还是很简单,我们可以直接累加,然后计算最大的,并且计算他所在的位置
在Python更是简单,我们可以直接利用他内置的函数,就能很快的得到我们的结果,结果当然是100啦
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# @File : 201909-1.py
# @Time : 2021/11/20 12:24:49
# @Author : DKJ
# @Contact : 1016617094@qq
# @Software: VScode# here put the import libn,m = map(int,input().split())data = []
max_c = 0
for i in range(n):x = list(map(int,input().split()))c = sum(x[1:])if c*-1 > max_c:max_c = c*-1index = i+1data.append(x[0]+c)
print(sum(data),index,max_c)'''
example 1:
3 3
73 -8 -6 -4
76 -5 -10 -8
80 -6 -15 0167 2 23example 2:
2 2
10 -3 -1
15 -4 017 1 4
'''
本文发布于:2024-03-14 13:53:09,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/1710822774149692.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
| 留言与评论(共有 0 条评论) |