hdu3355 Bomb

来源:互联网 发布:java volatile 原子性 编辑:程序博客网 时间:2024/06/16 22:38
Description
The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the current number sequence includes the sub-sequence "49", the power of the blast would add one point. 
Now the counter-terrorist knows the number N. They want to know the final points of the power. Can you help them? 
 
Input
The first line of input consists of an integer T (1 <= T <= 10000), indicating the number of test cases. For each test case, there will be an integer N (1 <= N <= 2^63-1) as the description. 


The input terminates by end of file marker. 
 
Output
For each test case, output an integer indicating the final points of the power.
 
Sample Input
3
1
50
500 
 
Sample Output
0
1
15 
Hint

From 1 to 500, the numbers that include the sub-sequence "49" are "49","149","249","349","449","490","491","492","493","494","495","496","497","498","499", so the answer is 15.



0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 学生信息管理C语言 construct2 employee 拼音转数字 JAVA拼音转数字 C加密字符串 日本女优无码下载迅雷 定义一个字符串类String,实现判断该字符串是否为回文字符串 字符串类String回文字符串 判断字符串是否为回文字符串 RRC ERAB E-RAB Linux用gred命令单词长度大于等于5 使用重定向命令完成2个文件合并 使用重定向完成文本文件的拷贝 Linux查找时候不现实出错信息 Linux去掉某个文件所有者同组用户的写权限 求方程式ax2 GNAB-011 flash制作课件 有数组$array=array(“a”=>2,”b”=>6,”c”=>5) 有数组$array=array(“a”=>2,”b”=>6,”c”=>5) 有数组$array=array(“a”=>2,”b”=>6,”c”=>5)排序 php对一个数组按某个键值排序 有数组$array=array(“a”=>2,”b”=>6,”c”=>5);用php实现对以上数组进 $array=array(“a”=>2,”b”=>6,”c”=>5);用php实现对以上数组大小排序 $array=array(“a”=>2,”b”=>6,”c”=>5) $array=array(“a”=>2,”b”=>6,”c”=>5)排序 Linux去掉某个文件所有者同组用户的写权限 Linux.sed命令显示某个文件的第五行 Linux输出该文件的奇数行 Linuxsed命令在文件的最后一行插入该文件的的统计信息,包含多少行,多少个单词,多个字符 Linuxcut命令 Linux.cut命令 Linux.cut命令提出a文件中 Linux.cut命令提出a文件中 Linux.ls Linux创建文件 Linux修改文件的时间 Linux创建文件