题解 | #成绩排序#

成绩排序

https://www.nowcoder.com/practice/8e400fd9905747e4acc2aeed7240978b

import sys

n, m = int(input()), bool(int(input()))
L = []
for line in sys.stdin:
    a = line.split()
    L.append((a[0], int(a[1])))
L.sort(key=lambda x: x[1], reverse=not m)
for a in L:
    print(a[0] + " " + str(a[1]))

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-24 18:34
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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