All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > General
Electric car (Posted on 2002-08-29) Difficulty: 4 of 5
You have an electric car that you want to use to transport some batteries 1,000 miles. You have 3,000 batteries, but your car can only carry 1,000 of them at once. In addition, for each mile that it travels, the car will need to use up one battery in order to power itself.

How many unspent batteries will you be able to transfer to your destination?

See The Solution Submitted by levik    
Rating: 4.3846 (13 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Just a guess | Comment 12 of 16 |
OK, I'm feeling lazy, so let's do this the simple way -- 334. If I load up and go 333 from Point A toward point B, then drop off 334 and return, I just make it back to my 2000. Then if I go to 333, and drop off the dead batteries, pick up 333 of the 334, then go 166 miles and drop off all but 449 of my batteries, i.e. 334, at the 500 mile marker. I can return to Point A, picking up my one remaining at mile 333. Then I can pick up my last 1000 batteries and head to 500 where I dump my 500 dead ones, pick up the 334 live, and go the rest of the way with 334 live left when I arrive at point B.

I never studied algorithms in school, so I dunno if that's the most efficient way, but I like it.
  Posted by Lawrence on 2003-08-27 15:59:37
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (24)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information