当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5907:Find Q

题目描述
Byteasar is addicted to the English letter 'q'. Now he comes across a string $S$ consisting of lowercase English letters.

He wants to find all the continous substrings of $S$, which only contain the letter 'q'. But this string is really really long, so could you please write a program to help him?
输入解释
The first line of the input contains an integer $T(1\leq T\leq10)$, denoting the number of test cases.

In each test case, there is a string $S$, it is guaranteed that $S$ only contains lowercase letters and the length of $S$ is no more than $100000$.
输出解释
For each test case, print a line with an integer, denoting the number of continous substrings of $S$, which only contain the letter 'q'.
输入样例
2
qoder
quailtyqqq
输出样例
1
7
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 BestCoder Round #88

源链接: HDU-5907

最后修改于 2020-10-25T23:26:37+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 262144/131072K(Java/Others)