#K44902. Maximum Binary Number by Bit Flip
Maximum Binary Number by Bit Flip
Maximum Binary Number by Bit Flip
You are given n binary strings. By applying a series of bit flip operations, you can turn any bit from 0
to 1
. Your task is to determine the maximum achievable binary number by flipping bits optimally. Note that the maximum binary number that can be obtained will have all bits set to 1
with a length equal to the maximum length among the given binary strings.
Input Format: The first line contains an integer n, representing the number of binary strings. This is followed by n lines where each line contains a binary string.
Output Format: Output a single binary string consisting entirely of the character 1
, where its length is equal to the maximum length among the input binary strings.
Note: All operations are assumed to be optimal, and you only need to determine the final string.
inputFormat
The input is given via stdin and is structured as follows:
n binary_string_1 binary_string_2 ... binary_string_n
Here, n is a positive integer indicating the number of binary strings, and each binary_string is a sequence of characters '0' and '1'.
outputFormat
The output should be printed on stdout as a single binary string which consists entirely of '1's. The length of this string should be equal to the maximum length among the provided binary strings.
## sample3
101
110
011
111
</p>