March 4, 2015
25 horse races, 5 runways, which means that 5 horses can compete at the same time. Ask the least number of races to know the 5 horses that run fastest.
Divide the horse into a, B, C, D, E five groups.
第1-5次 Competition: Each group to play the game, to decide the rank of each group
A1, A2, A3, A4, A5,
B1, B2, B3, B4, B5,
。。。。
。。。。。。 E4, E5.
6th races: A1, B1, C1, D1, E1,
First place is the fastest runner.
7th competition: Match the next dismount of the last group and the remaining 4 horses of the number 1th,
The first is the second fastest horse, because there are only 4 places, so the slowest horse to run and the remaining horses in the group are all eliminated.
8th tournament: Match the next horse of the last group, the next horse of the last group and the remaining 3 horses.
The first is the third fastest horse, because there are only 3 places, so the slowest running two horses and the remaining horses in the group are all eliminated.
In the remaining races to eliminate the slow, will be ranked later in the game, up to the 10th time to choose the fastest 5 horses. If the first few in a match are in the same group and the selected Ma Jiajue is greater than or equal to 5, the top 5 can be identified in advance.
So you can pick the fastest 5 horses in 8-10 times.
Algorithm-track and horse-Baidu face questions