2029Palindromes

2029   Palindromes

题目描述

A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is read from left to right as when the string is read from right to left.
Now give you a string S, you should count how many palindromes in any consecutive substring of S.

输入格式:

There are several test cases in the input. Each case contains a non-empty string which has no more than 5000 characters.
Proceed to the end of file.

输出格式:

A single line with the number of palindrome substrings for each case.
输入样例 复制
aba
aa
输出样例 复制
4
3

说明

23
99
通过提交
时空限制2000ms/64mb
题目来源Zhejiang Provincial Programming Contest 2006
评测方式在线评测
题目类型字符串
难        度