题解 | 最厉害的学生

最厉害的学生

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]}")

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务