Problem 1869 --Happiness

1869: Happiness

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $7$ 正确数量 $1$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签

       Chicken brother is very happy today, because he attained N pieces of biscuits whose tastes are A or B. These biscuits are put into a box. Now, he can only take out one piece of biscuit from the box one time. As we all know, chicken brother is a creative man. He wants to put an A biscuit and a B biscuit together and eat them. If he take out an A biscuit from the box and then he take out a B biscuit continuously, he can put them together and eat happily. Chicken brother’s happiness will plus one when he eat A and B biscuit together one time.

      Now, you are given the arrangement of the biscuits in the box(from top to bottom) ,please output the happiness of Chicken Brother when he take out all biscuit from the box. 

       The first line is an integer indicates the number of test cases.

       In each case, there is one line includes a string consists of characters ‘A’ and ‘B’.

       The length of string is not more than 1000000. 

     For each test case:

    The first line output “Case #k:", k indicates the case number.    

    The second line output the answer. 

1
ABABBBA
Case #1:
2

推荐代码 查看1869 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$16 $ms] 时涛涛@计算机科学与技术162 84295 2017-04-26 20:15:42
内存最少[$2500 $KB] 时涛涛@计算机科学与技术162 84295 2017-04-26 20:15:42
第一AC 时涛涛@计算机科学与技术162 84295 2017-04-26 20:15:42
第一挑战 AOJ大管家 84166 2017-04-26 12:52:00

赛题来源/所属竞赛 NA N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛
1080 2017ACM集训赛 2017-04-26 12:00:00 请登录