PLD - Palindromes
A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction, e.g. 'racecar', 'solos'.
You are given a number k (2≤k≤30000) and a non-empty string S whose length does not exceed 30000 lowercase letters.
We say two palindromes are different when they start from different positions. How many different palindromes of the length k does S contains?
The first line contains K. The second line contains S. K does not exceed the length of S.
The first and only line should consist of a single number - the number of palindromes found.
Input: 5 ababab Output: 2
why always time limit exceeds..
lowercase letters mean it contains of english alphabets?
Hy Trường Sơn:
I think that O(N*logN) algorithm will pass :D
does O(nlogn*logn) pass?
why am i getting internal error??
is O(n*k) algorithm supposed to give tle where n is the string length?Last edit: 2010-05-15 17:57:29
Are the palindromes which are lexicographically equal but starting from different positions considered as "DIFFERENT" palindromes ?
How many test cases in this problem? Only one?