Problem1391--统计回文子串

1391: 统计回文子串

Time Limit: 1 Sec  Memory Limit: 32 MB
Submit: 4  Solved: 4
[Submit] [Status] [Web Board] [Creator:]

Description

现在给你一个字符串S,请你计算S中有多少连续子串是回文串。

Input

输入包含多组测试数据。每组输入是一个非空字符串,长度不超过5000。

Output

对于每组输入,输出回文子串的个数。

Sample Input Copy

aba
aa

Sample Output Copy

4
3

Source/Category