摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4507用dp结构体里面存有符合要求的个数cnt,各位数和的sum1,符合要求的数的平方和sum2三个值。在维护sum2时需要用到sum1和cnt两个值。数位dp 1 #include 2 #include 3 ... 阅读全文
posted @ 2014-10-22 23:23 null1019 阅读(195) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3709题意:在一个区间内有多少个,可以一这个数中的一个数字为支点,两边的数字乘上边距的和相等。数位dp,枚举支点。 1 #include 2 #include 3 #include 4 #define ll ... 阅读全文
posted @ 2014-10-22 19:50 null1019 阅读(174) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3652数位dp题意:求1到n中能被13整除且含有13的数的个数。dp[i][j][k][c]表示dfs到i位,余数为j,是否含有13的标志k,最后一个数为m的有多少个符合要求的数。dfs枚举每一位。 1 #incl... 阅读全文
posted @ 2014-10-22 11:27 null1019 阅读(103) 评论(0) 推荐(0) 编辑