#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. linux环境下启动tomcat7出现时间过长(已经编译完成的项目)问题解决!

    已经编译完成的项目,系统启动过程中,提示: INFO: Starting Servlet Engine: Apache Tomcat/7.0.81 Sep 20, 2017 3:17:32 PM or ...

  2. Impala 安装笔记3一impala安装

    安装impala之前,确认满足Cloudera Impala Requirements中要求的所有条件: Supported Operating Systems Supported CDH Versi ...

  3. Safair 浏览器cllick事件不生效或者需要双击才生效

    针对Safair 浏览器cllick事件不生效或者需要双击才生效的解决方案. 方法一:给元素加上cursor: pointer样式.(不生效) 方法二:ios事件机制不一样,将click事件改为mou ...

  4. vue-面试

    1.单页面应用与多页面应用的去别 2.简述一下Sass.Less,且说明区别? 他们是动态的样式语言,是CSS预处理器,CSS上的一种抽象层.他们是一种特殊的语法/语言而编译成CSS.变量符不一样,l ...

  5. Python序列——字符串

    字符串 1 string模块预定义字符串 2 普通字符串与Unicode字符串 3 只适用于字符串的操作 4 原始字符串 5 Unicode字符串操作符 内建函数 1 标准类型函数与序列操作函数 2 ...

  6. Technocup 2017 - Elimination Round 2 C. Road to Cinema —— 二分

    题目链接:http://codeforces.com/problemset/problem/729/C C. Road to Cinema time limit per test 1 second m ...

  7. HDU6025 Coprime Sequence —— 前缀和 & 后缀和

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6025 Coprime Sequence Time Limit: 2000/1000 MS (Java/ ...

  8. centos6.5安装jdk

    1.查看Linux环境自带JDK 使用命令:# rpm -qa|grep gcj 显示内容其中包含相应信息# java-x.x.x-gcj-compat-x.x.x.x-xxjpp# java-x.x ...

  9. linux应用之gcc编译器的安装及使用

    gcc是linux系统下功能十分强大的编译器. 本人使用的是CentOS 6.6 64位系统,由于在安装系统的时候并没有勾选安装gcc编译器,因此需要自行安装gcc编译器. 使用yum安装gcc 对于 ...

  10. hdu-5750 Dertouzos(数论)

    题目链接: Dertouzos Time Limit: 7000/3500 MS (Java/Others)     Memory Limit: 131072/131072 K (Java/Other ...