全站唯一python题解!超级少!仅9行
2025-10-07 18:21:41
发布于:浙江
8阅读
0回复
0点赞
n, m = map(int, input().split())
candidates = [tuple(map(int, input().split())) for _ in range(n)]
candidates.sort(key=lambda x: (-x[1], x[0]))
cutoff_rank = int(m * 1.5) - 1
cutoff_score = candidates[cutoff_rank][1]
finalists = [c for c in candidates if c[1] >= cutoff_score]
print(cutoff_score, len(finalists))
for c in finalists:
print(c[0], c[1])
这里空空如也

有帮助,赞一个