Sub-palindromes
(Time limit: 2 sec. Memory limit: 16 MB Difficulty: 59%)
A string is called a palindrome if it is read equally from left to right and from right to left. For example, the strings "abba" and "ata" are palindromes.
A substring of some string is a nonempty sequence of consecutive characters in the original string.
Find out how many substrings of a given string are palindromes.
Input
The only line of input contains a string consisting of characters with ASCII codes 33 to 127. The string length can be up to 105.
Output
Output one integer.
Samples
№ | INPUT.TXT | OUTPUT.TXT |
1 | AAAA | 10 |
2 | ABRACADABRA | 13 |
3 | ABACABADABACABA | 32 |
Для отправки решения задачи необходимо зарегистрироваться и авторизоваться!
|