当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2575:Count Problem

题目描述
In this problem,we need to count the number that accord with the following rule(include the input number n).Read a integer number n(1<=n<=2^31 - 1) first,then do as following ways:
(1)Do nothing, then exit the process.
(2)Add a digit to the left of it,but the digit should not bigger than the half of the original first digit.For example,from 36 to 136 is legal,but 36 to 236 is illegal because 2 is bigger than half of 3.
(3)After add the digit,continue the process,until could not add digit anymore.
输入解释
The first line of the input contains an integer T which means the number of test cases.Then T lines follow, each line starts with a number n(1<=n<=2^31 - 1).
输出解释
For each test case, you should output one line contains the number that accord with the rule start from n.
输入样例
2
1
6
输出样例
1
6

提示
The first case 1 cannot any digital to the leftmost, so the number so only 1.
The second case 6 can add 1, 2, 3 to the leftmost so 16,26,36 are legal. And then 26, 36 also can add  1 to the leftmost so get 126, 136. So 6,16,26,36,126,136 are all legal.The result is 6.
来自杭电HDUOJ的附加信息
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2575

最后修改于 2020-10-25T22:54:49+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)