Edit Distance
Time limit1sMemory limit512 MB
Given a binary string S, output a binary string T of the same length whose edit distance from S is more than half the length of S.
Problem
A binary string is a non-empty sequence of 0's and 1's, e.g., , , , etc. The edit distance of two binary strings and , denoted by , is the minimum number of single-character edit (insert, delete, or substitute) to modify into . For example, the edit distance of and is , i.e. . The edit distance of and is , i.e. .
Ayu has a binary string . She wants to find a binary string with the same length as that maximizes the edit distance with . Formally, she wants to find a binary string such that and for all binary string satisfying .
She needs your help! However, since she wants to make your task easier, you are allowed to return any binary string with the same length as such that the edit distance of and is more than half the length of . Formally, you must return a binary string such that and .
Of course, you can still return if you want, since it can be proven that for any binary string . This also proves that there exists a solution for any binary string . If there is more than one valid solution, you can output any of them.
Input
Input contains a binary string ().
Output
Output in a line a binary string with the same length as that satisfies .