#include <iostream>
#include <stdio.h>
#include <cstring>
using namespace std; int ss(int m,int n)
{
int ans=0,flag,a[10];
for(int h=m; h<=n; h++)
{
int s = h;
memset(a,0,sizeof(a));
flag=0;
while(s)
{
int k = s%10;
a[k]++;
// cout<<a[k]<<endl;
s/=10;
}
for(int i=0; i<=9; i++)
if(a[i]>=2)
{
flag=1;
break;
}
if(flag==0)
ans++;
}
return ans;
}
int main()
{
int t,a,b;
cin>>t;
while(t--)
{
cin>>a>>b;
cout<<ss(a,b)<<endl;
}
return 0;
}

HDU5327的更多相关文章

随机推荐

  1. Expert Shell Scripting

    Expert Shell Scripting 好好学习这本书

  2. [BZOJ 1026] [SCOI 2009] Windy数 【数位DP】

    题目链接:BZOJ - 1026 题目分析 这道题是一道数位DP的基础题,对于完全不会数位DP的我来说也是难题.. 对于询问 [a,b] 的区间的答案,我们对询问进行差分,求 [0,b] - [0,a ...

  3. 正则表达式:根据逗号解析CSV并忽略引号内的逗号

    需求:解析CSV文件并忽略引号内的逗号 解决方案: public static void main(String[] args) { String s = "a,b,c,\"1,0 ...

  4. 用它解决大问题啦,STRACE应用

    脚本是沙沙,辉哥和我在去年解决一个PHP时弄出来的...强! 简单而实用. 抓到的TRC文件放在TRC目录下. 如果有异常的进程或输出,可以在里面详细的分析.. #!/bin/bash mkdir t ...

  5. POJ-3580-SuperMemo(splay的各种操作)

    题意:对数组进行各种操作 其中 REVOLVE右移操作.将区间[a,b]右移c位 首先c可能比较多,可以先对区间长度取模. 在右移之后,可以发现[a,b]被分为两个区间[a,b-c]  [b-c+1, ...

  6. Linux Shell编程(4)——shell特殊字符(上)

    在脚本或其他别的地方出现的特殊字符#注释. 以一个#开头的行 (#!是例外) 是注释行.# 这是一行注释.注释也可以出现在一个命令语句的后面.echo "A comment will fol ...

  7. 【转】文件读写NDK(或Linux)

    原文网址:http://www.ithao123.cn/content-10709539.html 使用NDK进行文件读写,有利于保存数据的安全性,项目需要,要文件读写从Java中处理搬到Linux平 ...

  8. AC自动机(Aho-Corasick automation)模板 HDU:2222

    #include <iostream> #include <cstdio> #include <cstring> #include <queue> us ...

  9. Unique Paths ——LeetCode

    A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The ...

  10. Using Apache Web Server with Jboss AS 7

    In real-world projects, it's common to find Apache web server as a front door to your application se ...