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

建议使用的浏览器:

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

6230:Palindrome

题目描述
Alice like strings, especially long strings. For each string, she has a special evaluation system to judge how elegant the string is. She defines that a string $S[1..3n-2](n \geq 2)$ is one-and-half palindromic if and only if it satisfies $S[i]=S[2n-i]=S[2n+i-2] (1\leq i \leq n)$.For example, $abcbabc$ is one-and-half palindromic string, and $abccbaabc$ is not. Now, Alice has generated some long strings. She ask for your help to find how many substrings which is one-and-half palindromic.
输入解释
The first line is the number of test cases. For each test case, there is only one line containing a string(the length of strings is less than or equal to $500000$), this string only consists of lowercase letters.
输出解释
For each test case, output a integer donating the number of one-and-half palindromic substrings.
输入样例
1
ababcbabccbaabc
输出样例
2
提示
In the example input, there are two substrings which are one-and-half palindromic strings, $abab$ and $abcbabc$.
来自杭电HDUOJ的附加信息
Recommend jiangzijing2015

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

源链接: HDU-6230

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

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 262144/262144K(Java/Others)