难度:++++
经典的穿越沙漠题本来是这样的:假设有N桶油(比如说5桶),一辆车。一桶油可以让车开一个单位的距离,车的油箱恰好和一个油桶一样大。途中任何地方都可以储存任意数量的油。这辆车能穿越多宽的沙漠?
这个问题不难,但不太实际:没有容器,油怎么能放在沙漠里?我们把题改得实际一点(但是难了很多):
假设有2N桶油(算10桶吧),一辆车。一桶油可以让车开1/2个单位的距离,车的油箱恰好和一个油桶一样大,而且车上还可以装一个桶。如果车上有油桶,油桶和里面的油可以储存在途中任何地方。这辆车能穿越多宽的沙漠?
I assume the truck has an empty tank at first. The first barrel of gas can move the other M = 2N-1 barrels x units of distance, we have (M*2-1)*x = 1/2, so x = 1/(2*(2M-1)) Similarly, the second barrel of gas can move the other M-1 barrels 1/(2*(2(M-1)-1)), and so on, so the max distance will be: 1/(2*(2M-1))+1/(2*(2(M-1)-1)+...1/(2*2)+1/2+1/2 Do I miss something? Cause this doesn't seem like a ++++ in constant's scale. |
A correction: It should be 1/(2*(2M-1))+1/(2*(2(M-1)-1)+...1/(2*3)+1/2+1/2. But the problem is that this is not optimal. |
不好意思, 经典的答案是什么? |
经典的答案是1+1/3+1/5+...+1/(2N-1),方法就是QL给出的。 |
我还是不懂 能不能不说英文 |
欢迎光临 珍珠湾ART (http://66.160.158.134/) | Powered by Discuz! X3 |