3415. Palindrome

单点时限: 1.0 sec

内存限制: 512 MB

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 is one-and-half palindromic if and only if it satisfies . 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.

输入格式

There is only one line containing a string (the length of string is less than or equal to ). The string only consists of lowercase letters.

输出格式

Output an integer denoting the number of one-and-half palindromic substrings.

样例

Input
abcbabc
Output
1
Input
abccbaabc
Output
0
Input
ababcbabccbaabc
Output
2

4 人解决,5 人已尝试。

5 份提交通过,共有 11 份提交。

9.6 EMB 奖励。

创建: 1 年,4 月前.

修改: 1 年,4 月前.

最后提交: 1 年,4 月前.

来源: CCPC 2017 Harbin Site

题目标签