![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数位DP
芋智波佐助
菜鸟一只
展开
-
CodeForces 204A Little Elephant and Interval 数位DP
#include #include using namespace std; typedef __int64 LL; int a[33]; LL dp[33][10]; LL dfs(int x, int s, int e, int flag, int first) { if(x == -1) return s == e; if(!flag && dp[x][原创 2015-02-09 13:18:38 · 897 阅读 · 0 评论 -
HDU 3886 Final Kichiku “Lanlanshu” 数位DP
给你一个字符串/表示当前位比前一位小-表示和前一位相等\ 表示比前一位大 求a到b之间有多少个数满足方案 dp[i][j][k] 到第i位满足字符串的第j位前一位是k的方案数 #include #include using namespace std; const int maxn = 110; char s[maxn], A[maxn], B[maxn]; int a[max原创 2014-11-13 09:31:58 · 1351 阅读 · 0 评论 -
UVa 11361 Investigating Div-Sum Property / 数位DP
先上代码 以后再说 #include #include const int maxn = 110; int dp[maxn][maxn][maxn]; int ok(int x, int k) { if(x < 10) return x / k; int a = x; int b = 1; int l = 0; while(a) { l++; a /= 10; b原创 2014-01-30 18:39:27 · 1206 阅读 · 0 评论