A8813 | Little Elephant and Bits
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
The Little Elephant has an integer $a$ , written in the binary notation. He wants to write this number on a piece of paper.
To make sure that the number $a$ fits on the piece of paper, the Little Elephant ought to delete exactly one any digit from number $a$ in the binary record. At that a new number appears. It consists of the remaining binary digits, written in the corresponding order (possible, with leading zeroes).
The Little Elephant wants the number he is going to write on the paper to be as large as possible. Help him find the maximum number that he can obtain after deleting exactly one binary digit and print it in the binary notation.
To make sure that the number $a$ fits on the piece of paper, the Little Elephant ought to delete exactly one any digit from number $a$ in the binary record. At that a new number appears. It consists of the remaining binary digits, written in the corresponding order (possible, with leading zeroes).
The Little Elephant wants the number he is going to write on the paper to be as large as possible. Help him find the maximum number that he can obtain after deleting exactly one binary digit and print it in the binary notation.
输入格式
The single line contains integer $a$ , written in the binary notation without leading zeroes. This number contains more than $1$ and at most $10^{5}$ digits.
输出格式
In the single line print the number that is written without leading zeroes in the binary notation — the answer to the problem.
输入输出样例
输入 #1
101
输出 #1
11
输入 #2
110010
输出 #2
11010
In the first sample the best strategy is to delete the second digit. That results in number $11_{2}=3_{10}$ .
In the second sample the best strategy is to delete the third or fourth digits — that results in number $11010_{2}=26_{10}$ .
In the second sample the best strategy is to delete the third or fourth digits — that results in number $11010_{2}=26_{10}$ .
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted