hdu 3652(数位dp)
摘要:
题意:求解x,y区间中有13字串并且能出13的数的个数思路:数位dp+记忆化搜索,dp[i][j][k]表示处理到第i位,mod13的余数为j,且状态为k的数的个数。k=0表示已经出现了串13,k=2表示前一个数字是1,k=1表示剩余状态。最终结果为dp[pos][0][0]pos为数的位数。View Code 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstring> 5 #include<cmath> 6 using names 阅读全文
posted @ 2012-09-07 22:09 huangriq 阅读(234) 评论(0) 推荐(0)
浙公网安备 33010602011771号