
数位DP
lqybzx
123
展开
-
Codeforces 288E Polo the Penguin and Lucky Numbers
题目大意:我们定义只含有4或者7的数为“幸运数”现在给你L,R,问你L到R之间的幸运数的和答案对10^9+7取模(1看到数字第一个想到的就是数位DP。我们用sx[i][4]表示长度为i且开头为4的幸运数的和用sx[i][7]表示长度为i且开头为7的幸运数的和s[i][4]和s[i][7]分别表示长度为i的开头分别为4和7的幸运数个数f[i][原创 2015-11-28 17:27:01 · 1664 阅读 · 0 评论 -
2016多校训练Contest5: 1007 K-wolf Number hdu5787
Problem DescriptionAlice thinks an integer x is a K-wolf number, if every K adjacent digits in decimal representation of x is pairwised different.Given (L,R,K), please count how many K-wolf numb原创 2016-08-02 22:59:53 · 516 阅读 · 0 评论 -
hdu2089:不要62
Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和原创 2016-07-29 14:09:19 · 405 阅读 · 0 评论 -
hdu3709: Balanced Number
Problem DescriptionA balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the di原创 2016-07-29 16:09:09 · 428 阅读 · 0 评论 -
bzoj 4521: [Cqoi2016]手机号码
Description人们选择手机号码时都希望号码好记、吉利。比如号码中含有几位相邻的相同数字、不含谐音不吉利的数字等。手机运营商在发行新号码时也会考虑这些因素,从号段中选取含有某些特征的号码单独出售。为了便于前期规划,运营商希望开发一个工具来自动统计号段中满足特征的号码数量。工具需要检测的号码特征有两个:号码中要出现至少3个相邻的相同数字,号码中不能同时出现8和4。号原创 2016-07-29 14:48:00 · 641 阅读 · 0 评论 -
bzoj 1833: [ZJOI2010]count 数字计数
Description给定两个正整数a和b,求在[a,b]中的所有整数中,每个数码(digit)各出现了多少次。Input输入文件中仅包含一行两个整数a、b,含义如上所述。Output输出文件中包含一行10个整数,分别表示0-9在[a,b]中出现了多少次。Sample Input1 99Sample Output9 20 20 20 20原创 2016-07-31 15:14:17 · 520 阅读 · 0 评论 -
2016多校训练Contest6: 1011 Zhu’s Math Problem hdu5803
Problem DescriptionZhu is a powerful ACMer/OverWatcher, now a salt-fish comes to ask Zhu a difficult problem. Zhu thinks that problem is so easy, so he wants to know whether you can solve it?The原创 2016-08-07 15:45:12 · 668 阅读 · 0 评论 -
hdu 5898 odd-even number 2016ACM/ICPC沈阳赛区网络赛1007
Problem DescriptionFor a number,if the length of continuous odd digits is even and the length of continuous even digits is odd,we call it odd-even number.Now we want to know the amount of odd-even原创 2016-09-18 22:49:19 · 817 阅读 · 0 评论