Pro.ID22664 TitleString reduction Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22664 AC0 Submit0 Ratio- 时间&空间限制描述There is a string of characters 'a' and 'b' with the length of no more than 255 characters. You can perform the substring reduction on the initial string in the following way: a substring "a*a" or "b*b" (where * (asterisk) denotes any character) can be reduces to a substring "*" . The task is to achieve a string of minimal possible length after several substring reductions. 输入Input is the the initial string. 输出Description There is a string of characters 'a' and 'b' with the length of no more than 255 characters. You can perform the substring reduction on the initial string in the following way: a substring "a*a" or "b*b" (where * (asterisk) denotes any character) can be reduces to a substring "*" . The task is to achieve a string of minimal possible length after several substring reductions. Input Input is the the initial string. Output Output a single line with the minimal possible length. Sample Input aab Sample Output 3 Source 样例输入aab 样例输出3 作者 |