Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Programming Languages
C, C++ and C#
Can't solve this problem from my university
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="WhiteCube, post: 5171615, member: 92459"] This is like the classic problem of the camel crossing the desert with 3000 bananas. The 20 litre fuel tank does make things more interesting. To move n barrels, one at a time, from depot A to depot B, costs 1 barrel, when the distance from A to B is 1000/(n+n-1) km. n+n-1 trips On the other hand, using the idea of a way station, if the first barrel is dropped half way between A and B, and the truck refuels with it every trip, then the depots can be slightly further away. 1000/(n+n-2) km n+n-2 trips Driver's choice 1, use the waystation method to move 250 km. 2 barrels left. Driver's choice 2, use 80 litres to move 800/3 km. 1.2 barrels left. Driver's choice 3, use everything to move 1200 km. total: 1716 + 2/3 km. Choice 1 is not the best way to use 1 of 3 barrels, another way to save a trip is to use the tank, leaving an empty barrel at depot A. Driver's choice 1a, use 60 litres to move 600/5 km (5 trips), then use 40 litres to move 400/3 km (3 trips). 253 + 1/3 km. total: 1720 km. [/QUOTE]
Verification
Post reply
Forums
Programming Languages
C, C++ and C#
Can't solve this problem from my university
Top