由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 49两赛车,取第25名
相关主题
赛车问题问个老题
两道题也来发个经典的dynamic programming问题
请教两道赛马题。这道题怎么办?
25匹马找前5名的老题答案是啥?100% Travel 意味着什么?
赛马题最近面经经常见的一题
请问49horse的答案这道题DP怎么做阿
问一道Brain Teaser题dp problem on mit
Interview Questions for an investment bank2D median problem
相关话题的讨论汇总
话题: a4话题: b4话题: b1话题: b2话题: a1
进入JobHunting版参与讨论
1 (共1页)
w**********9
发帖数: 20
1
49 辆赛车. Assume for each one, it travels the track in the same amount
of time every time. Also assume no two finish the track in the same
amount of time. Suppose you have 7 tracks, but no timer. Design races to
find the 25-th fastest with minimal number of races.
mitbbs 曾经讨论过这个题,当时没有注意,现在已经搜索不到了。 欢迎大家讨论讨论
想了一个解法,不清楚还有没有更优解,特来请教
7次, 跑出 A1, A2, .... A7
B1, B2, ... B7
..
..
G1, G2, .....G7

第8次, 取 A4, B4, C4, .....G4
不失一般性,设A4为第一,B4为第二....
这样, A1, A2, A3, A4, B1, B2, 肯定在前24名(包括第24名)


再跑19次得到第25名
共需要 7 + 1 + 19 = 27次
a***c
发帖数: 2443
2
the problem doesn't look like it's set up right. needs more constraints to
make a meaningful problem.
Does the original question say you can't race 49 cars all at once?
j*****4
发帖数: 292
3
use median finding algorithm

【在 w**********9 的大作中提到】
: 49 辆赛车. Assume for each one, it travels the track in the same amount
: of time every time. Also assume no two finish the track in the same
: amount of time. Suppose you have 7 tracks, but no timer. Design races to
: find the 25-th fastest with minimal number of races.
: mitbbs 曾经讨论过这个题,当时没有注意,现在已经搜索不到了。 欢迎大家讨论讨论
: 想了一个解法,不清楚还有没有更优解,特来请教
: 7次, 跑出 A1, A2, .... A7
: B1, B2, ... B7
: ..
: ..

a***c
发帖数: 2443
4
best case 10 races with 1/19 chance.
don't know about worst case, 19? there's probably room for improvement here.
w**********9
发帖数: 20
5


【在 j*****4 的大作中提到】
: use median finding algorithm
w**********9
发帖数: 20
6
不知道能不能说得详细点呢?我的这个方法第8步是median finding, 但第9步后,感
觉不太好弄。

【在 j*****4 的大作中提到】
: use median finding algorithm
1 (共1页)
进入JobHunting版参与讨论
相关主题
2D median problem赛马题
被雷BF事件后续, 哈哈, 我们结婚了 (转载)请问49horse的答案
[合集] 被雷BF事件后续, 哈哈, 我们结婚了 (转载)问一道Brain Teaser题
算法面试题Interview Questions for an investment bank
赛车问题问个老题
两道题也来发个经典的dynamic programming问题
请教两道赛马题。这道题怎么办?
25匹马找前5名的老题答案是啥?100% Travel 意味着什么?
相关话题的讨论汇总
话题: a4话题: b4话题: b1话题: b2话题: a1