UVA 1647 Computer Transformation】的更多相关文章

https://vjudge.net/problem/UVA-1647 题意: 开始有一个1,接下来每一步1变成01,0变成10 问n不之后00的个数 打表找规律 第3步之后: 如果第i步之后有x个字符, 那么第i+1步之后 的后x个字符与第i步一样 前x个字符是第i步取反 所以00得个数由三部分组成 1.上一步00的个数 2.上一步11的个数 3.当i为偶数时,前x个字符的最后一个是0,后x个字符的第一个是0,00个数+1 f[i][0]=f[i-1][0]+f[i-1][1]+!(i&1)…
题意:初始串为一个1,每一步会将每个0改成10,每个1改成01,因此1会依次变成01,1001,01101001,……输入n(n<=1000),统计n步之后得到的串中,"00"这样的连续两个0出现了多少次. 分析:找规律,输出n等于20之前所有的结果 得到结论,i为奇数时,a[i] = a[i - 1] * 2 - 1; i为偶数时,a[i] = a[i - 1] * 2 + 1. import java.util.*; import java.math.BigInteger;…
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…
题意: 有一个01串,每一步都会将所有的0变为10,将所有的1变为01,串最开始为1. 求第n步之后,00的个数 分析: 刚开始想的时候还是比较乱的,我还纠结了一下000中算是有1个00还是2个00 最终想明白后,并不会出现这样的子串. 总结了几个要点: 第n步之后,串的长度为2n,且0和1的个数相等,分别为2n-1 1经过两步变化为1001,所以每个1经过两步变化就会得到一个00,而且这个00分别被左右两边一个1包围着,不会与其他数字凑出额外的00 0经过两步变化为0110,所以00就会变成0…
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.…
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…