Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
55541 | wangchenglin | 病人排队 | Python3 | 解答错误 | 34 MS | 3684 KB | 529 | 2024-11-08 12:04:29 |
num_patients = int(input()) seniors = [] non_seniors = [] for _ in range(num_patients): patient_info = input().split() patient_id = patient_info[0] age = int(patient_info[1]) if age >= 60: seniors.append((patient_id, age)) else: non_seniors.append((patient_id, age)) seniors.sort(key=lambda x: (-x[1], seniors.index(x))) non_seniors.sort(key=lambda x: non_seniors.index(x)) for senior in seniors: print(senior[0]) for non_senior in non_seniors: print(non_senior[0])