夜间过桥
River Crossing
题目详情
夜里四人 A、B、C、D 需要过桥,只有一盏手电且一次最多两人同行。A 过桥 10 分钟,B 5 分钟,C 2 分钟,D 1 分钟。两人同行速度取慢者。
问:四人全部过桥最少需要多少时间?
Four people, A, B, C, and D, need to get across a river at night. There is only one flashlight, and at most two people can cross on the old bridge at once. A takes 10 minutes, B takes 5 minutes, C takes 2 minutes, and D takes 1 minute. When two people cross, they walk at the speed of the slower person. What is the minimum total time for all four to get across?
解析
最少 17 分钟。一种最优策略:
- C、D 过去(2 分钟)
- D 回来(1 分钟)
- A、B 过去(10 分钟)
- C 回来(2 分钟)
- C、D 再过去(2 分钟)
总计 。
Original Explanation
The minimum total time is 17 minutes. One optimal strategy:
- C and D go across (takes 2 min).
- D returns (1 min).
- A and B go across (10 min).
- C returns (2 min).
- C and D go across again (2 min).
Total: 2 + 1 + 10 + 2 + 2 = 17 minutes.