#P10168. [DTCPC 2024] 0=1=0
[DTCPC 2024] 0=1=0
Problem Description
You are given a string that contains only and .
Each time, you may choose an index , and flip and separately.
Flipping results in , and flipping results in .
You need to maximize the number of ordered pairs, i.e., maximize the number of pairs such that and .
Output a solution.
Input Format
One line containing a string ().
Output Format
The first line outputs a number, representing the maximum number of ordered pairs.
The second line outputs a number , representing the number of operations.
Then output one line with numbers. The -th number means that in the -th operation, you flip and .
You must ensure that the number of operations does not exceed , but you do not need to minimize the number of operations.
111100
8
2
1 5
Hint
Translated by ChatGPT 5