[算法]数位DP [题解]数位dp总结 之 从入门到模板 #include<cstdio> #include<algorithm> #include<cstring> using namespace std; ; int n,a[maxn],NUM[maxn]; long long f[maxn]; struct cyc{int num/*数字数*/;long long ans/*1的数量*/;}qp; cyc dfs(int deep,bool limit)//返回1…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3555 Problem Description The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the curre…
If we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number. You are required to count the number of good numbers in the range from A to B, inclusive. InputThe first line has a number T (T <=…
#include <bits/stdc++.h> typedef long long LL; const int MOD = (int)1e9 + 7; LL L,R,G,T; int dp[62 + 1][2][2][2][2]; bool vis[62 + 1][2][2][2][2]; inline void add(int &a,int b) { a += b; if (a >= MOD) a -= MOD; if (a < 0) a += MOD; } int c…