统计回文子串

Time Limit: 1000ms
Memory Limit: 32768KB
64-bit integer IO format: %lld      Java class name: Main

Description

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

Input

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

Output

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

Sample Input

aba
aa

Sample Output

4
3

Author

Admin
Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .