2.	
#include <iostream>
#include <cstring>
#define LL long long
using namespace std;
LL l, r;
LL f[12][10][10][2][2][2], a[20];
LL Dfs(LL now, LL p, LL pp, LL _4, LL _8, LL top, LL hw) {
    if(_4 && _8)
        return 0;
    if (!now)
        return hw;
    if(!top && f[now][p][pp][_4][_8][hw]!=-1)
        return f[now][p][pp][_4][_8][hw];
    LL Up= top?a[now]: 9;
    LL ret(0);
    for(LL i=0; r<= Up; ++i)
        ret += Dfs(now-1,i,p,_4|(i==4),_8|(i==8),
                   top&&(i==Up), hw|(i==pp&&i==p));
    if(!top)
        f[now][p][pp][_4][_8][hw]= ret;
    return ret ;
}
inline LL Solve(LL x) {
    LL tot(0);
    while (x) {
        a[++tot]= x% 10;
        x/= 10;
    }
    if(tot != 11)
        return 0;
    LL ret(0);
    for (LL i= 1; i<= a[tot]; ++i)
        ret +=Dfs(tot-1,i,0,(i==4),(i==8),i==a[tot],0);
    return ret;
}
int main() {
    cin>>l>>r;
    memset(f,-1,sizeof(f));
    cout<< Solve(r) - Solve(l-1);
    return 0;
}
判断题
1) 同时包含4和8的数字都不可能被统计。(
 
 
2) 相邻数位中,位中。超过3个数位相同的数字都不可能被统计。( )
 
 
选择题
3) (4分)下列哪个是合法(可能会被优计)的数字?( )
 
 
 
 
4) (5分)当输入12121000 12121350时1序输出结果为( )