三名傳教士和三名食人族必須使用一艘最多能載兩人的船渡河,並且受到以下限制:在河的兩岸,如果有傳教士在場,他們的人數不能少於食人族(否則食人族會吃掉傳教士)。
船不能沒有人而自行渡河。請找出將所有人安全送到對岸所需的最少船隻行程數。
Three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionaries present on the bank, they cannot be outnumbered by cannibals (if they were, the cannibals would eat the missionaries).
The boat cannot cross the river by itself with no people on board. Find the smallest number of boat trips needed to get everyone safely across the river.
沒有留言:
張貼留言