22664_Stringreduction

2022-5-16 18:22| 发布者: Hocassian| 查看: 17| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506833779700-Problem List-采集的数据-后羿采集器.html

Pro.ID

22664

Title

String reduction

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22664

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    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

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部