### raihatneloy's blog

By raihatneloy, history, 4 years ago, ,

How to solve this problem? I tried a lot of ideas. I used here: 1. Segment tree in every node of segment tree (Gives MLE) 2. Segment Tree in every node of BIT (gives MLE) 3. Avl tree in every node of segment tree (gives TLE) 4. Splay tree in every node of segment tree (gives TLE)

Please, help needed. :( I want to solve this prpblem

• +9

By raihatneloy, 4 years ago, ,

Can this problem be solved using Suffix Automaton? I want to know if we can solve this using this algorithm. Can anyone please share any ideas? Thanks in advance :)

• -2

By raihatneloy, 4 years ago, ,

This Solution got AC, but it gave wrong output for the input below:

3 1
a
b
c
aaaaa


The program gave output: YES but I think the output should be: NO

Am I right? If I'm, then the data set may b too weak! :(