num = int(input()) sj = input() dict1 = dict() for i in range(num): name, total = input().split() dict1[i] = name + " " + total if sj == "0": key = sorted(dict1, key=lambda x: int(dict1[x].split()[1]), reverse=True) for i in key: print(dict1[i]) if sj == "1": key = sorted(dict1, key=lambda x: int(dict1[x].split()[1])) for i in key: print(dict1[i])
点赞

相关推荐

瑞雪兆丰年_:可以贴个超级大的校徽,以防HR眼拙
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务