英語(yǔ)翻譯
英語(yǔ)翻譯
So the real problem is that problem solving does not belong to the things Charlie is good at.Actually,the only thing Charlie is really good at is "sitting next to someone who can do the job".And now guess what — exactly!It is you who is sitting next to Charlie,and he is already glaring at you.
Luckily,you know that the following algorithm works for n = 1 disks on tower A are fixed and the remaining n-k disks are moved from tower A to tower B using the algorithm for four towers.Then the remaining k disks from tower A are moved to tower D using the algorithm for three towers.At last the n - k disks from tower B are moved to tower D again using the algorithm for four towers (and thereby not moving any of the k disks already on tower D).Do this for all k 2 ∈{1,.,n} and find the k with the minimal number of moves.
So for n = 3 and k = 2 you would first move 1 (3-2) disk from tower A to tower B using the algorithm for four towers (one move).Then you would move the remaining two disks from tower A to tower D using the algorithm for three towers (three moves).And the last step would be to move the disk from tower B to tower D using again the algorithm for four towers (another move).Thus the solution for n = 3 and k = 2 is 5 moves.To be sure that this really is the best solution for n = 3 you need to check the other possible values 1 and 3 for k.(But,by the way,5 is optimal...)
So the real problem is that problem solving does not belong to the things Charlie is good at.Actually,the only thing Charlie is really good at is "sitting next to someone who can do the job".And now guess what — exactly!It is you who is sitting next to Charlie,and he is already glaring at you.
Luckily,you know that the following algorithm works for n = 1 disks on tower A are fixed and the remaining n-k disks are moved from tower A to tower B using the algorithm for four towers.Then the remaining k disks from tower A are moved to tower D using the algorithm for three towers.At last the n - k disks from tower B are moved to tower D again using the algorithm for four towers (and thereby not moving any of the k disks already on tower D).Do this for all k 2 ∈{1,.,n} and find the k with the minimal number of moves.
So for n = 3 and k = 2 you would first move 1 (3-2) disk from tower A to tower B using the algorithm for four towers (one move).Then you would move the remaining two disks from tower A to tower D using the algorithm for three towers (three moves).And the last step would be to move the disk from tower B to tower D using again the algorithm for four towers (another move).Thus the solution for n = 3 and k = 2 is 5 moves.To be sure that this really is the best solution for n = 3 you need to check the other possible values 1 and 3 for k.(But,by the way,5 is optimal...)
英語(yǔ)人氣:531 ℃時(shí)間:2020-01-28 04:37:43
優(yōu)質(zhì)解答
So the real problem is that problem solving does not belong to the things Charlie is good at. Actually, the only thing Charlie is really good at is "sitting next to someone who can do the job". And no...
我來(lái)回答
類似推薦
猜你喜歡
- 1反函數(shù)的概念及其一般求法...
- 2trans globe coaches 怎么翻譯
- 3生命本是一場(chǎng)漂泊的旅途,遇到誰(shuí)都是一個(gè)美麗的意外,我珍惜每一個(gè)可以讓我稱作朋友的人.感謝我今生相
- 4計(jì)算2√27×1/3√5
- 518個(gè)11和11個(gè)13和10個(gè)14的積的末尾數(shù)字是多少?
- 6如圖,點(diǎn)D,E分別在△ABC的邊BC,BA上,四邊形CDEF是等腰梯形,EF∥CD.EF與AC交于點(diǎn)G,且∠BDE=∠A. (1)試問(wèn):AB?FG=CF?CA成立嗎?說(shuō)明理由; (2)若BD=FC,求證:△ABC是等腰三角形.
- 7She saus that she'll___(住在一個(gè)太空站)in the future.
- 8576人排成三層空心方陣,求這個(gè)空心方陣第二層每邊幾人?
- 9求(3分之x+根號(hào)x分之3)的9次方的展開(kāi)式常數(shù)項(xiàng)和展開(kāi)的中間兩項(xiàng)
- 10君生我未生,我生君已老出自哪 全文是什么
- 117.6÷4.2+2.4×0.25簡(jiǎn)便計(jì)算
- 12青尼羅河發(fā)源于埃塞俄比亞高原,冬季多雨,使尼羅河下游經(jīng)常泛濫成災(zāi)這句話哪里錯(cuò)了?