weaksmk spoj

how to solve weaksmk spoj

http://www.spoj.com/problems/WEAKSMK/

This appears to to be the same problem as SUBQUERY. You can check out the editorial. I’m afraid I don’t know about suffix automaton at the moment so I can’t help you further :confused: