#C1239. Equal Ones and Zeros
Equal Ones and Zeros
Equal Ones and Zeros
Given a binary string, determine whether the number of 1
's is equal to the number of 0
's. More formally, let \( n_1 \) be the count of ones and \( n_0 \) be the count of zeros in the string. The output should be True
if \( n_1 = n_0 \) and False
otherwise.
Note that the input will be provided via standard input (stdin), and the result should be printed to standard output (stdout).
inputFormat
The input consists of a single line containing a binary string (a sequence composed only of the characters '0' and '1').
outputFormat
Output a single line: True
if the number of ones is equal to the number of zeros; otherwise, output False
.
101010
True