A7789 | Hexadecimal's Numbers
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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除了以二进制格式写成的数字之外,不接受任何其他形式的信息。这意味着,如果十进制表示中的数字包含除
感谢[Macw](https://www.acgo.cn/person/929871)提供翻译
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](https://www.acgo.cn/person/929871)提供翻译
输入格式
Input data contains the only number $n$ ( $1<=n<=10^{9}$ ).
输入包含一个整数$n(1 \le n \le 10^9)$。
输入包含一个整数$n(1 \le n \le 10^9)$。
输出格式
Output the only number — answer to the problem.
输出一个整数,代表本道题的答案。
输出一个整数,代表本道题的答案。
输入输出样例
输入 #1
10
输出 #1
2
For $n$ = 10 the answer includes numbers 1 and 10.
**请注意,本题空间限制为64MB,是默认空间限制的二分之一。**
**请注意,本题空间限制为64MB,是默认空间限制的二分之一。**
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted