摘要: 101010属于周期循环的二进制,循环次数为3现在给你十进制的区间,求出有周期循环的数的个数思路: 枚举循环的周期的长度,但注意周期长度所包含的因子长度不能重复计算。 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<cstdlib> 5 typedef long long LL; 6 int const N = 70; 7 LL dp[N],p2[N]; 8 int bit[N],ln; 9 void pre()10 {11 p2[0]=1;12 for 阅读全文
posted @ 2013-05-21 19:29 诺小J 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 题意:1245 这个数属于上升长度为4的数字,1213这个数字属于上升长度为3的数字。统计区间[l,r]中上升长度为k的数字个数。State 状态压缩,表示最长上升的序列用到的数字有哪些 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<cstdlib> 5 typedef long long LL; 6 int const N = 22; 7 int const M = 1030; 8 int bit[N],ln,pow2[11],k; 9 LL dp[ 阅读全文
posted @ 2013-05-21 19:25 诺小J 阅读(375) 评论(0) 推荐(0) 编辑