25 匹马找最快 3 匹
Horse Race
题目详情
有 25 匹马,速度各不相同且恒定。跑道一次最多比赛 5 匹。
问:要保证找出最快的 3 匹马,最少需要多少场比赛?
You have 25 horses, each with a unique constant speed. There is a track that can race 5 horses at a time. You want to find the fastest 3 horses. What is the minimum number of races (heats) needed to guarantee finding the top 3?
解析
最少需要 7 场。
思路:
-
先把 25 匹分成 5 组各 5 匹,组内各跑 1 场,共 5 场,得到每组内部排序。
-
让 5 个组冠军再跑 1 场(第 6 场),确定冠军组及其他组的相对强弱。
-
只剩少量仍可能进入前三的候选(来自冠军组前 3、亚军组前 2、季军组前 1),再跑 1 场(第 7 场)即可确定总前三。
Original Explanation
The minimum number of races is 7. Strategy:
- Divide into 5 groups of 5. Run 5 races, one per group.
- Take each group’s winner and run the 6th race among those 5 winners.
- Based on the results, eliminate groups that cannot produce a top 3 contender, and run the 7th race among the plausible candidates only.
- The final top 3 in the 7th race are the 3 fastest overall.