You and 3 friends are partying it up on your private island late one night when all of a sudden the sirens go off. The island is sinking. The only way off the island is by walking across an old wooden bridge which can only support the weight of 2 people at a time. Since its night time you'll want to make sure 1 of the 2 people crossing the bridge brings a flashlight so you don't accidentally walk off the bridge. Unfortunately you only have 1 flashlight.
Some of your friends move slower than others. For example, if you want to cross the bridge with Friend C it will take 5 minutes because you can't leave them behind without the flashlight. Here is the time chart of how long it takes each friend to cross.
You - 1 minute Friend B - 2 minutes Friend C - 5 minutes Friend D - 10 minutes
What's the fastest time everyone can get off the island?
Comments:
tehMagik - 10 years, 9 months ago
you = A
A & B -> 2 min. A <- 1 min C & D -> 10 min B <- 2 min A & B -> 2 min
17 min total
reply permalink
Max Burstein - 10 years, 9 months ago
Nice work! 17 is indeed the answer
reply permalink
Anonymous - 10 years, 9 months ago
you = A <- holds flashlight location a bridge cost location b (total) C+D A+B -> 2 min 0 min C+D A+B 2 min A+C+D A<- 1 min B 2 min A+C+D B 3 min D A+C -> 5 min B 8 min D A+B+C 8 min D A <- 1 min B+C 9 min A+D B+C 9 min A+D -> 10 min 19 min A+B+C+D 19 min
This should be solution if i am not mistaken, still have to pogram it.
reply permalink
Carlos - 10 years, 9 months ago
You = A; A+B -> 2m; A <- 1m; C+D -> 10m; B <- 2m; A+B -> 2m; Total time: 2+1+10+2+2 = 17m;
A bit too easy this one, assuming that i am correct :D
reply permalink
dmguerra - 10 years, 9 months ago
a and b cross together - 2 a goes back - 1 c and cross together - 10 b goes back - 2
a and b cross together - 2
reply permalink