1445: Repeat Number
来源:互联网 发布:淘宝直播难申请成功 编辑:程序博客网 时间:2024/06/05 08:26
1445: Repeat Number
Time Limit: 1 Sec Memory Limit: 32 MBSubmit: 194 Solved: 54
[Submit][Status][Web Board]
Description
Definition: a+b = c, if all the digits of c are same ( c is more than ten),then we call a and b are Repeat Number. My question is How many Repeat Numbers in [x,y].
Input
There are several test cases.
Each test cases contains two integers x, y(1<=x<=y<=1,000,000) described above.
Proceed to the end of file.
Output
For each test output the number of couple of Repeat Number in one line.
Sample Input
1 10
10 12
Sample Output
5
2
HINT
If a equals b, we can call a, b are Repeat Numbers too, and a is the Repeat Numbers for itself.
Source
偷偷打个假表强行算了,没花多少时间#include<cstdio>int main(){int a,b,i,ans,x[100]={11,22,33,44,55,66,77,88,99,111,222,333,444,555,666,777,888,999,1111,2222,3333,4444,5555,6666,7777,8888,9999,11111,22222,33333,44444,55555,66666,77777,88888,99999,111111,222222,333333,444444,555555,666666,777777,888888,999999,1111111,2222222};while(~scanf("%d%d",&a,&b)){ans=0;for(i=0;i<50;i++){if(x[i]>=a*2&&x[i]<=b*2){ans+=x[i]/2+1-((a>x[i]-b)?a:(x[i]-b));}}printf("%d\n",ans);}}
阅读全文
0 0
- ZCMU-1445-Repeat Number
- 1445: Repeat Number
- Repeat Number
- Repeat Number
- Repeat Number
- 2014辽宁省赛 Repeat Number
- kuangbin群赛-1002-Repeat Number
- repeat
- Algorithm-Arrays-5 Repeat and Missing Number Array
- Repeat Part of the Regex a Certain Number of Times (重复匹配中的部分)
- background-repeat:no-repeat
- Finding a number that repeats even no of times where all the other numbers repeat odd no of times
- Repeat分页
- selective repeat
- background-repeat
- repeat嵌套
- repeat until
- Angularjs repeat
- 算法系列——矩形覆盖(剑指offer)
- esayui datagrid JQuery 一般用的方法
- 内存管理
- C#中串口接收数据触发事件
- Google的工程师每天能写多少的代码呢?
- 1445: Repeat Number
- Clion this file does not belong to any project target
- 【Tomcat】Linux下关于Tomcat部署项目的问题总结
- Unity Shader 内置函数
- DNS 之 EDNS机制详解
- 分享的图片
- Myeclipse在debug时,查看表达式整体的值 快捷键
- 总结
- HBase与hive集成