2746AC!

2746   AC!

题目描述

lets AC this problem!

In this problem, you are given a string and need find its longest substring which has the same number of character ‘A’ and character’C’ .

Notice that the string will only contain ‘A’ and ‘C’ which are all in uppercase letter and no longer than 1000000.

输入格式:

The first line contains a T which means the number of data sets

Each of next T lines contains a string mentioned above.    T <= 10

输出格式:

for each data set, output answer in one line.

输入样例 复制
1
ACAA
输出样例 复制
2

说明

28
247
通过提交
时空限制1000ms/128mb
题目来源
评测方式在线评测
题目类型
难        度