Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Holiday - Brain teasers
Message
De
04/01/2000 12:39:38
 
 
À
23/12/1999 20:38:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00308199
Message ID:
00312524
Vues:
58
>>>>>Nope. I only have 2 in the boat. One is always a cannibal. If the cannibal takes a missionary over first, then goes back to pick up another passenger, does the cannibal in the boat count as being back on the other side? If so, I do not see a workable solution.
>>>>
>>>>The answer is yes. And there is a workable solution. If you want I can private message you the answer.
>>>
>>>Does the boat always have to be piolted by a missionary or a cannibal? e.g., 1 of each can't just cross, both get out, and the ones still on the other side pull the empty boat back across with a rope.
>>
>>The boat always has to be piloted by a missionary or a cannibal.
>
>Ah, this answers my question on the other branch of this thread. It does count if the person crosses. It is solvable, the trick is at least one of the times you have to send 2 people back across the river. Here's my solution (C for cannibal, M for missionary). The parens show the change in people distribution in the form of orginal_shore,new_shore with => to show transitions.
>
>1. C and M row across, the M rows back (CCCMMM,none => CCMM,CM => CCMMM,C)
>2. Two C row across, one C rows back (CCMMM,C => MMM,CCC => CMMM,CC)
>3. Two M row across, one C and one M row back (CMMM,CC => CM,CCMM => CCMM,CM)
>4. Two M row across, the C rows back (CCMM,CM => CC,CMMM => CCC,MMM)
>5. Two C row across, one C rows back (CCC,MMM => C,CCMMM => CC,CMMM)
>6. The remaining two C row across
>
>Okay, now I can get back to work without this bugging me.

Melissa Danforth is correct. The only difference that I have is the first step I send to cannibals but the rest is the same.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform