EOJ 1821 Hanoi Tower III
摘要:
http://acm.cs.ecnu.edu.cn/problem.php?problemid=1821这题就等价于普通的汉诺塔,只是每一层移动两次,原来需要2^n - 1次,则现在需要2^(n + 1) - 2次,递推式为f(i) = 2 * f(i - 1) + 2 1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 unsigned long long f[62]; 5 int main() 6 { 7 f[1] = 2; 8 for (int i = 2; i < 62; i 阅读全文
posted @ 2013-06-21 13:12 KimKyeYu 阅读(182) 评论(0) 推荐(0) 编辑