CF9C.Hexadecimal's Numbers
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
One beautiful July morning a terrible thing happened in Mainframe: a mean virus Megabyte somehow got access to the memory of his not less mean sister Hexadecimal. He loaded there a huge amount of n different natural numbers from 1 to n to obtain total control over her energy.
But his plan failed. The reason for this was very simple: Hexadecimal didn't perceive any information, apart from numbers written in binary format. This means that if a number in a decimal representation contained characters apart from 0 and 1, it was not stored in the memory. Now Megabyte wants to know, how many numbers were loaded successfully.
Hexadecimals的数
一个美丽的七月早晨,在主机城发生了一件可怕的事情:一种恶意病毒Megabyte以某种方式获得了对他同样恶意的姐姐Hexadecimal的内存访问权限。他在那里加载了从 1 到 n 的 $$ 个不同自然数,以获取对她能量的完全控制。
但他的计划失败了。原因很简单:Hexadecimal除了以二进制格式写成的数字之外,不接受任何其他形式的信息。这意味着,如果十进制表示中的数字包含除0
和1
之外的字符,则不会存储在内存中。现在Megabyte想知道成功加载了多少个数字。
感谢Macw提供翻译
输入格式
Input data contains the only number n ( 1<=n<=109 ).
输入包含一个整数n(1≤n≤109)。
输出格式
Output the only number — answer to the problem.
输出一个整数,代表本道题的答案。
输入输出样例
输入#1
10
输出#1
2
说明/提示
For n = 10 the answer includes numbers 1 and 10.
请注意,本题空间限制为64MB,是默认空间限制的二分之一。