py只通过第一个测试点求助!

P5740 【深基7.例9】最厉害的学生

_XiaoXi @ 2021-12-24 20:21:41

n = int(input())
arr = [[] for i in range(n)]
temp = []
d = []
if n > 1:
    for i in range(n):
        arr[i] = list(map(str,input().split()))
        temp.append(arr[i][0])
        del arr[i][0]

    for i in range(len(arr[i])):
        arr[i] = list(map(int,arr[i]))
        d.append(sum(arr[i]))

    m = d.index(max(d))
    print(temp[m],' '.join(str(i) for i in arr[m]),end ='')
else:
    print(input())

|