数位dp 数位dp是一种计数用的dp,一般就是要统计一段区间$[L,R]$内,满足一定条件的数的个数,或者各个数位的个数. 数位dp使得暴力枚举变为满足一定状态的记忆化,更加优秀. 数位dp常常会考虑以下问题: 1.前导零的处理$lead$ 2.枚举的上界$limit$ 3.得到答案的条件 一般数位dp的模板 #include<bits/stdc++.h> using namespace std; #define re register int #define int long long in…
1363: Count 101 Submit Page Summary Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 393 Solved: 154 Description You know YaoYao is fond of his chains. He has a lot of chains and each chain has n diamonds on it. There are two kinds…