
动态规划-数位DP
Toooooocold
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
UVALive 6575 Odd and Even Zeroes
n!中有几个0等价于1~n中有min(因子2的个数,因子5的个数),因为因子2的个数必大于因子5的个数,ans为n/5+n/25+n/125… 将n转为5进制,假设n为1234,那么ans为(123+12+1|五进制)。此时要判断ans是否为偶数。 注意到如果一个数x为偶数进制,列如十进制,那么只要判断最后一个数是否是偶数即可,因为其他位的数都是乘以10的幂次,乘积皆为偶数,只有最后一位是乘以1原创 2017-08-04 00:42:23 · 378 阅读 · 0 评论 -
Codeforces 55D Beautiful numbers
数位DP #include using namespace std; const int MAXN = 48; const int MOD = 2520; typedef __int64 ll; ll dp[20][MOD+5][MAXN]; int a[20], h[MAXN]; void ini() { memset(dp, -1, sizeof(dp)); in原创 2017-02-03 14:36:59 · 260 阅读 · 0 评论