|
|
Four Men Crossing a Bridge(supposedly from the Microsoft interview process)
There are four people who would all like to cross a rickety old bridge. The old bridge will only support 2 people at a time, and it is night time, so every crossing must use the one flashlight that they all share. The four people each have different walking speeds: the fastest each of them can cross is 1 minute, 2 minutes,5 minutes,and 10 minutes. If they pair up, since they must share the flashlight, they can only cross in the time that it would take the slower of the two. Given that the shortest time to get them all across is 17 minutes total, how should they all cross?
呵呵,这是我今天computer science课上发的练习题,题上写着是微软的招聘题目
嘿嘿,微软的招聘题目也不过如此吧~
对大家来说,是不是小菜一碟??? |
|