摘要: https://www.luogu.org/team/show?teamid=2961 由普通汉诺塔问题,设数量为n时移动次数为a[n],则a[n]=a[n-1]+1+a[n-1]=2*a[n-1]+1. // 因为a[1]=1,所以a[n]=2^n-1.(找规律?) 故双塔就是2*(2^n-1). 阅读全文
posted @ 2019-01-05 17:31 XXrl 阅读(704) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P1044 1.用dfs来做,记录以备用 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstring> 5 #includ 阅读全文
posted @ 2019-01-05 14:35 XXrl 阅读(173) 评论(0) 推荐(0) 编辑