题解 | 最厉害的学生
最厉害的学生
https://www.nowcoder.com/practice/b6e7a9ca04d8418b805b3b4b7d25b4d4
N = int(input())
T = []
t = []
S = []
for _ in range(N):
s, c1, c2, c3 = map(lambda x: int(x) if x.isdigit() else x, input().split())
T.append(c1 + c2 + c3)
t.append((c1, c2, c3))
S.append(s)
max_value = max(T)
index = T.index(max_value)
print(f"{S[index]} {t[index][0]} {t[index][1]} {t[index][2]}")
查看2道真题和解析