hdu1041】的更多相关文章

#include <iostream> #include <string> using namespace std; const int SIZE = 1001; const int BASE = 10; string result[SIZE]; string two("2"); void initial() { int mcarry, temp, carry; int k; string tempResult; result[1] = "0"…
Computer Transformation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8688    Accepted Submission(s): 3282 Problem Description A sequence consisting of one digit, the number 1 is initially wr…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1041 题意:电脑中存在数字1,进行扩展操作,如果遇到1变为“01”,如果遇到0,变为“10”,经过一次变换称为“01”,两次“1001”,三次“01101001”, 求经过n次变换,得到的01序列中有多少对相邻的0. 思路:先打表得到规律1,1,3,5,11,21,43…… 找规律可以发现 1*2+1=3: 1*2+3=5: 3*2+5=11: 5*2+11=21: ……: 之后就是求和的事了,由于…
Description A sequence consisting of one digit, the number 1 is initially written into a computer. At each successive time step, the computer simultaneously tranforms each digit 0 into the sequence 1 0 and each digit 1 into the sequence 0 1. So, afte…