数位dp
Falling~
这个作者很懒,什么都没留下…
展开
-
数位dp--cf96e Horse races
给定k,求[l,r]内lucky number个数。r的范围到1e1000。 1.lucky number是至少存在2个lucky digit的距离小于等于k,并不要求所有都小于等于k。 lucky digit是4和7. 2.lpos的范围也是maxn = 1000 + 5 //f(r) - f(l - 1) == f(r) - f(l) + (l符合) ? 1 : 0 #i原创 2017-08-14 16:43:17 · 313 阅读 · 0 评论 -
数位dp--HYSBZ1026 windy数
windy数,相邻数字相差大于等于2. #include #include #include using namespace std; int bits[12]; int dp[12][10][2]; int dfs(int len,int pre,bool lead,bool border)//第len个数,前一个数为pre,是否原创 2017-08-10 10:25:10 · 254 阅读 · 0 评论 -
数位dp--hdu3652 B-number
A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can be divided by 13. For example, 130 and 2613 are wqb-numbers, but 143 and 2639 ar原创 2017-08-09 20:35:51 · 277 阅读 · 0 评论