
数位DP
wwt9b15bs
这个作者很懒,什么都没留下…
展开
-
【题解】hdu2089 数位DP
题目链接 dp[i][j]表示开头是j的i位数中的吉利数个数 dp[i][j]=dp[i-1][k]其中j!=4且当j=6时k!=2 从高到低枚举哪一位比n的哪一位小 #include<cstdio> #include<cstring> int dp[10][10],n,m; int bit[10];//存每一位的值 void init() { dp[...原创 2018-08-18 07:36:51 · 292 阅读 · 0 评论 -
【题解】hdu3555 数位DP
题目链接 问含有49的子串个数,dfs做 #include<cstdio> #include<cstring> typedef long long ll; const int N=30; ll dp[N][2]; ll z[N]={1}; int t; ll n; int bit[N]; ll dfs(int len,bool is4,bool ismax) { ...原创 2018-08-18 07:36:56 · 225 阅读 · 0 评论 -
【题解】[牛客OI周赛2-提高组]C.好朋友 数位DP
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; template<typename tp>inline void read(tp&x) { x=0;int f=0;char ch=getchar(); while(ch<'...原创 2018-10-31 20:28:13 · 443 阅读 · 0 评论