Computer Transformation(hdoj 1041)】的更多相关文章

Problem 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.…
Computer Transformation http://acm.hdu.edu.cn/showproblem.php?pid=1041 Problem 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…
Computer Transformation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6946    Accepted Submission(s): 2515 Problem Description A sequence consisting of one digit, the number 1 is initially wri…
Computer Transformation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8367    Accepted Submission(s): 3139 Problem Description A sequence consisting of one digit, the number 1 is initially wri…
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…
H - Computer Transformation Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice _ Appoint description:  System Crawler  (Oct 10, 2016 1:02:59 PM) Description A sequence consisting of one digit, the numb…
这道题目的意思是:一开始有一个数字 1 ,在接下来的时间中,计算机会按照如下规则进行扩展:                0 –> 1 0                1 –> 0 1 求n秒之后,有多少对相邻的0. 例如1 0 0 1有 1 对相邻的0.   这道题目是一道规律题,可以直接例举前面的数据得到规律: 0 0 1 1 3 5 11 21 43 85 通过例举的数据可以很明显的看出,从第 1s 开始,如果是偶数秒,那么b[ i ] = b[ i – 1 ] * 2 – 1,而奇数…
主要还是找规律,然后大数相乘 #include<stdio.h> #include<string.h> #include<math.h> #include<time.h> #include<map> #include<iostream> #include<ctype.h> #include<string> #include<algorithm> #include<stdlib.h> #i…
本题假设编程是使用DP思想直接打表就能够了. 假设是找规律就须要数学思维了. 规律就是看这些连续的0是从哪里来的. 我找到的规律是:1经过两次裂变之后就会产生一个00: 00经过两次裂变之后也会产生新的00:故此须要记录好1和00出现的次数就能够递推出后面的00出现的数据了. 公式就是tbl00[i] = tbl00[i-2] + tbl1[i-2]; 当中tbl00是记录00出现的次数,tbl1是出现1出现的次数. 公式事实上是能够化简的,只是我懒得化简了.这种公式非常清楚了. 只是因为这种数…
http://acm.hdu.edu.cn/showproblem.php?pid=1041 有一个初始只有一个1的串 每次都按①0 -> 10;②1 -> 01;这两条规则进行替换 形如:n = 1  1 n = 2  01 n = 3  1001 ... 求经过n步替换之后 串中只含复数个0的连续子串(不难发现,这种子串只能是‘00’)的出现次数 因为0<n<=1000的限制 在最坏情况下(n==1000)串的长度将达到2^1000位 排除了直接模拟上述替换过程的可能 列出前几…