![]() |
||||||||||
|
||||||||||
The Number of PalindromesTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 4278 Accepted Submission(s): 1640 Problem Description Now, you are given a string S. We want to know how many distinct substring of S which is palindrome. Input The first line of the input contains a single integer T(T<=20), which indicates number of test cases. Each test case consists of a string S, whose length is less than 100000 and only contains lowercase letters. Output For every test case, you should output "Case #k:" first in a single line, where k indicates the case number and starts at 1. Then output the number of distinct substring of S which is palindrome. Sample Input
Sample Output
Source | ||||||||||
|