Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Finding Palindromes
Description A word is called a palindrome if we read from right to left is as same as we read from left to right. For example, "dad", "eye" and "racecar" are all palindromes, but "odd", "see" and "orange" are not palindromes. Given Input The first line of input file contains the number of strings The l small letters of English alphabet._{i}You can assume that the total length of all strings will not exceed 2,000,000. Two strings in different line may be the same. Output Print out only one integer, the number of palindromes. Sample Input 3 1 a 2 ab 2 ba Sample Output 5 Hint The 5 palindromes are:
a a aba aba abba baab
Source POJ Monthly--2007.09.09, Zhou Gelin, modified from POI06 |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator