link $solution:$ $10^{10} \leq L \leq R < 10^{11}$这个数据范围很容易想到数位$dp$. 依照题意模拟即可. #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #define int long long using namespace std; inline int read(){ ,ans=;char c=…
题目链接: http://bestcoder.hdu.edu.cn/contests/contest_showproblem.php?cid=677&pid=1003 题意: 求长度为n的序列中,每个字符(a~z)连续出现不超过3次的种数. 分析: 数位dp,设dp[i][j]表示进行到第i个字符,其中当前字符出现j次,然后每次状态转移一下就好了~ 代码: #include <cstdio> const int maxm = 2005, mod = 1e9+7; long long d…