#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <string>
#include <cmath> #define Faster ios::sync_with_stdio(false),cin.tie(0)
#define Read freopen("in.txt","r",stdin),freopen("out.txt","w",stdout)
#define Close fclose(stdin),fclose(stdout)
const int maxn = 1e5 + ;
using namespace std;
const int MOD = 1e9+;
typedef long long ll;
int a[maxn];
int dp[maxn][]; int dfs(int pos, int pre, int sta, bool limit){
if(pos == -) return ;
if(!limit && dp[pos][sta] != -) return dp[pos][sta];
int up = limit? a[pos]:;
int tmp = ;
for(int i = ;i <= up;i++){
if(pre == && i == )
continue;
if(i == )
continue;
tmp += dfs(pos-, i, i == , limit && i == a[pos]);
}
if(!limit) dp[pos][sta] = tmp;
return tmp;
} //从 1到x 的满足的数量
int solve(int x){
int pos = ;
while(x){
a[pos++] = x%;
x /= ;
}
return dfs(pos-, -, , true);
} int main(){
Faster;
int l, r;
while(cin >> l >> r){
if(l == && r == )
break;
memset(dp, -, sizeof dp);
int ans = solve(r) - solve(l-);
cout << ans << endl;
}
return ;
}

dalao博客:https://blog.csdn.net/wust_zzwh/article/details/52100392

C - 不要62的更多相关文章

  1. VS2015编译boost1.62

    VS2015编译boost1.62 Boost库是一个可移植.提供源代码的C++库,作为标准库的后备,是C++标准化进程的开发引擎之一. Boost库由C++标准委员会库工作组成员发起,其中有些内容有 ...

  2. P87LPC760/61/62/64/67/68/69/78/79芯片解密单片机破解价格

    NXP恩智浦P87LPC760/61/62/64/67/68/69/78/79芯片解密单片机破解 NXP LPC700系列单片机解密型号: P87LPC759.P87LPC760.P87LPC761. ...

  3. HDU2089 不要62[数位DP]

    不要62 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  4. Connection broken for id 62, my id = 70, error =

    启动费zokeeper失败,报错如下:Connection broken for id 62, my id = 70, error = 原因是因为zoo.cfg中server.id不正确. serve ...

  5. base64/62 加解密的实现。

    base64/62加解密代码下载地址: http://files.cnblogs.com/files/Kingfans/base64(62)加解密.zip base64: base62:

  6. /usr/include/sys/types.h:62: error: conflicting types for ‘dev_t’

    /usr/include/sys/types.h:62: error: conflicting types for ‘dev_t’/usr/include/linux/types.h:13: erro ...

  7. [HDU2089]不要62

    [HDU2089]不要62 试题描述 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer).杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就 ...

  8. NYOJ题目62笨小熊

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAr4AAAK1CAIAAAChInrhAAAgAElEQVR4nO3dO3LjutaG4X8Szj0Qxx

  9. 62个Android Studio小技巧合集

    1书签(Bookmarks) 描述:这是一个很有用的功能,让你可以在某处做个标记(书签),方便后面再跳转到此处. 调用:Menu → Navigate → Bookmarks 快捷键: 添加/移除书签 ...

  10. [ACM_水题] 不要62(hdu oj 2089, 不含62和4的数字统计)

    Problem Description 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer).杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来, ...

随机推荐

  1. SpringBoot-(4)-Filter的使用

    一,Filter Filter功能,它使用户可以改变一个 request和修改一个response. Filter 不是一个servlet,它不能产生一个response,它能够在一个request到 ...

  2. 关于4Ps 、4Cs 、4Rs 、4Vs营销策略的内容及优劣比较

  3. selenium2 浏览器版本问题

    一.chrome浏览器 chrome浏览器与驱动版本对应关系 ----------ChromeDriver v2.26 (2016-12-09)---------- Supports Chrome v ...

  4. ZOJ - 3932 Handshakes 【水】

    题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3932 题意 给出 N 个人,然后 1-N 然后 从 1 - N ...

  5. Zookeeper集群搭建安装

    三台 Linux虚拟机,每台都需要安装Jdk环境 1.上传Zookeeper安装包 (比较大 直接上传得了) 或者:wget https://mirrors.tuna.tsinghua.edu.cn/ ...

  6. Program received signal SIGSEGV, Segmentation fault.

    GDB调试的时候出现了: Program received signal SIGSEGV, Segmentation fault.(程序收到信号SIGSEGV,分段故障) SIGSEGV:在POSIX ...

  7. linux应用之php开发环境lamp搭建(centos)

    搭建linux+apache+mysql+php环境   1.安装apache: yum install httpd httpd-devel  启动apache: /etc/init.d/httpd ...

  8. CodeForces - 762E:Radio stations (CDQ分治||排序二分)

    In the lattice points of the coordinate line there are n radio stations, the i-th of which is descri ...

  9. python 基础之第十一天(面向对象)

    #############面向对象##################### 类: In [1]: class MyClass(object): ##用class定义一个类 ...: def psta ...

  10. JavaScript实现Select选择本周、上周、本季、上季、本年的时间选取

    //转自http://blog.csdn.net/xc_young/article/details/16878849,其上季度有错误,已修改 var MrYangUtil = function () ...