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
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
- hdu3355 Bomb
- Bomb
- Bomb
- Bomb
- Bomb
- Bomb
- bomb
- Bomb
- Bomb
- bomb
- hdu3555 Bomb
- Bomb lab
- Fork bomb
- ZIP BOMB
- Fork bomb
- hdu3555 Bomb
- HDU3555 Bomb
- hdu3555 Bomb
- Android Studio下的应用性能优化总结-内存优化
- Java中的向上类型转换和向下类型转换
- Android开发--Intent-filter属性详解
- 叠式的常规性转行分拆规则
- 欢迎使用CSDN-markdown编辑器
- hdu3355 Bomb
- linux下c编程socket通信
- MyeclipseTFS团队资源管理器插件
- Android 开发最佳实践
- 设计模式总
- Bigger多宝格 技术及介绍文档
- Linux下安装Tomcat服务器和部署Web应用
- avro
- CString转换成char*的最佳方案