|
|
Show all threads Hide all threads Show all messages Hide all messages | What algo? | bsu.mmf.team | 1842. Local Roots | 18 Apr 2024 22:03 | 6 | Finally I've solved this problem using very hard optimised Main & Lorentz's algo, and 0.405s only. But I noticed many people solved this problem very fast and using much less memory. What algo do you use? I doubt it's possible to speed-up Main & Lorentz or Crochemore algos so much. Is it some alternative (like suffix tree) solution, or just some strong idea can be applied to this particular problem? Is it possible to solve it in O(n)? I use something similar with manacher algorithm with some optimization.. I use this approach: first for every position find the answer which cover outside the string(using kmp algo) as estimate value, and sort the estimate value in desending order, then use bruteforce(hash+enum) to calc the answer inside the string.when estimate value <=ans break; this program make me 0.2s AC... Thank you, but your solution is either not very fast :) I believe there's a strict approach exists with a strict algo for this problem. My algorithm is similar to Shen Yang.But I also use exkmp to calc another two situaion. Then the estimate value will become smaller.I got AC in 0.046s. Look up Critical Factorization Theorem | error answer at test 10 -- how to find out what is wrong? | organmusic | 1842. Local Roots | 26 Apr 2015 17:56 | 1 | All of my home-made tests have been passed succesfully but what is the test 10 which gives an error? How to get the test and what result should be for it? Edited by author 26.04.2015 18:07 | what is perfix | shahmohammadi | 1842. Local Roots | 10 Dec 2011 02:40 | 2 | if in a case p is abcde, is ab a prefix of p? or ab is prifix of cde? in other word is prefix and suffix of a word a part of that or placed in out of it? thank you. thanks. now i know what problem want. and i know when we say A is Prefix/suffix of B,=> B includes A. |
|
|
|