首页 > Strange Towers of Hanoi
头像 陈柯蒙
发表于 2020-01-31 21:41:14
1 超硬核解法#include"iostream"using namespace std;int main(){ cout<<"1\n3\n5\n9\n13\n17\n25\n33\n41\n49\n65\n81\n"; return 0;}当然肯定不推荐这种方法的~下面就是 展开全文
头像 CAICAIIs
发表于 2019-08-26 13:26:06
题目描述BackgroundCharlie Darkbrown sits in another one of those boring Computer Science lessons: At the moment the teacher just explains the standard Tow 展开全文
头像 Trkly
发表于 2020-08-27 09:44:27
更好的阅读体验: https://www.cnblogs.com/Acapplella/p/13569669.html 题目描述 汉诺塔问题,条件如下: 这里有A、B、C和D四座塔。 这里有n个圆盘,n的数量是恒定的。 每个圆盘的尺寸都不相同。 所有的圆盘在开始时都堆叠在塔A上,且圆盘尺寸从塔顶到 展开全文
头像 PAFF
发表于 2021-09-28 20:48:39
汉诺塔多塔问题 这样想,如果把A杆上的一些盘移动到其他只要不是最终目的的杆上(比如B),那么只有在A杆剩下的盘子全都到最终目的杆上,B杆剩下的盘才会轮到去往最终目的杆 ps(废话,B杆上的都比A杆上的小,A杆不移完B杆也不能摞到最终目的杆上面啊) 然后,我们就只用考虑除去B杆以外的过程 然后,就会惊 展开全文