CF258A.Little Elephant and Bits
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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.
小象有一个整数 a,以二进制形式给出。他想把这个数写在一张纸上。
为确保数字 a 能够写在纸上,小象必须恰好从 a 的二进制表示中删除任意一位数字。这样便得到一个新数,它由剩余的二进制数字按原顺序组成(可能包含前导零)。
小象希望最终写在纸上的数尽可能大。请帮助他找出在恰好删除一位二进制数字后所能得到的最大数,并以二进制形式输出该数。
输入格式
The single line contains integer a, written in the binary notation without leading zeroes. This number contains more than 1 and at most 105 digits.
单行包含一个整数 a,以二进制形式给出,且不含前导零。该数的位数大于 1 且不超过 105。
输出格式
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 112 = 310.
In the second sample the best strategy is to delete the third or fourth digits — that results in number 110102 = 2610.
在第一个样例中,最优策略是删除第二个数字,结果得到数字 112=310。
在第二个样例中,最优策略是删除第三个或第四个数字,结果得到数字 110102=2610。
输入解题思路,AI测评打分。不知道怎么写?