返回题库

运油问题(3000 加仑,1000 英里,容量 1000

Oil Transport

专题
Brainteaser / 脑筋急转弯
难度
L4

题目详情

一艘油轮要把 3000 加仑油从港口 X 运到港口 Y,两港相距 1000 英里。

船每行驶 1 英里都会固定漏掉 1 加仑油(与载油量无关),且任何时刻最多只能装 1000 加仑。

船可以在途中任意位置建立储油点:把油卸下存放,之后再来取。

问:在最优方案下,最多能从 X 运到 Y 多少加仑油?(四舍五入到最接近的整数加仑。)

An oil tanker ship is transporting 30003000 gallons of oil from Port XX to Port YY which are 10001000 miles apart. However, the ship loses 11 gallon of oil for every mile it travels from spillage (at a constant rate) and can carry a max of 10001000 gallons at any time. The ship can also dump any oil that it is carrying at any number of storage ports on the way from Port XX to Port YY and pick it up later. Assuming an optimal travel plan where you decide where to place any number of storage ports and how to carry the oil, how many gallons can you transport from Port XX to Port YY (round to the nearest gallon)?

解析

这是经典“分段搬运 / 沙漠运香蕉”问题。

当剩余油量需要分成 kk 趟运输(每趟最多 1000)时,为把油向前推进 1 英里,需要有 2k12k-1 次穿越该 1 英里(来回搬运),因此每推进 1 英里净消耗 2k12k-1 加仑。

  • 初始 3000 加仑,需要 k=3k=3 趟,净消耗率 5 加仑/英里。推进 d1d_1 英里直到剩余 2000:
30005d1=2000d1=200.3000-5d_1=2000\Rightarrow d_1=200.
  • 剩余 2000 加仑,需要 k=2k=2 趟,净消耗率 3 加仑/英里。推进 d2d_2 英里直到剩余 1000:
20003d2=1000d2=10003.2000-3d_2=1000\Rightarrow d_2=\frac{1000}{3}.

此时已前进 200+10003=16003200+\frac{1000}{3}=\frac{1600}{3} 英里。

  • 剩余 1000 加仑只需 1 趟,消耗率 1 加仑/英里。剩余路程为
100016003=14003,1000-\frac{1600}{3}=\frac{1400}{3},

到达 Y 时剩余油为

100014003=16003533.33.1000-\frac{1400}{3}=\frac{1600}{3}\approx 533.33.

四舍五入得到 533\boxed{533} 加仑。