SUFEQPRE - Suffix Equal Prefix
There is a curious boy in noapara village , his name is “MODON”. He wrote a line of small letters only.
Now, he want to know how many proper suffix is also prefix of that line. Proper suffix is a suffix of a text whose length is less than the original text
Now you have to help “MODON”.
Input starts with an integer T (≤ 50), denoting the number of test cases.
Each case contains a string S where 1 ≤ length(S) ≤ 106.
For each case, print the case number and the answer .
3Output: Case 1: 2
Case 2: 3
Case 3: 1
Many WA's due to silly mistake! BTW EASY QUESTION WITH ENOUGH TIME LIMIT.
bad test, i realized that max length of string is 10^6+7Last edit: 2017-05-15 16:22:23
time limit is too strict. please correct the time limit.
time limit is too strict.string questions should pass in o(n) time.had similar problem with another of your question (TULIPNUM) .
Annoying time limit -_- -_-
i think there is problem here. has the time limits been reset.
[BITMEN] DARK LORD:
plz remove the comment of akash chourasiya..he post aanswer here..
As S.Y.P.Lai said, the test cases are very weak. Most of my AC solutions failed with his test cases.
The test cases are too forgiving. The string repeating patterns are too simple. I found that I can modify the code to skip full checking while getting ACed.