## Editorial for DMOPC '17 Contest 2 P4 - Mimi and Dictionary

Remember to use this editorial

**only**when stuck, and**not to copy-paste code from it**. Please be respectful to the problem author and editorialist.**Submitting an official solution before solving the problem yourself is a bannable offence.**Author:

For of points, we can iterate over all prefixes, and check if they are a palindrome in time, and see if the string exists in the remainder of the string in time.

**Time Complexity:**

For of points, we can iterate over all prefixes, and check if they are a palindrome in time, and see if the string exists in the remainder of the string in time, by using a linear time string finding algorithm, such as KMP or Rabin-Karp.

**Time Complexity:**

For the remaining of points, we can run Manacher's Algorithm, and then run the Z-Algorithm, and then use either binary search or preprocessing to determine the answer.

**Time Complexity:** or

## Comments

Time limit not strict enough. My algorithm passes without a problem.

Yea, unfortunately there are multiple solutions which pass, some of which perform even better than solutions even on specially crafted data.

wow its indcyc