num_total = int(input().strip()) sort_type = int(input().strip()) lis_res = [] for i in range(num_total): a_key,b_value = map(str,input().strip().split()) lis_res.append([a_key,int(b_value)])############要考虑到重名的同学 if sort_type == 0: lis_res.sort(key =lambda x:x[1],reverse= True) for x in lis_res: pri...