Блог пользователя rrpaim

Автор rrpaim, 10 лет назад, По-английски

Hello,

I'm having a hard time trying to solve this problem. I've already tried three different solutions, using Hash, Aho-Corasick and Suffix Array (O(n) implementation + Longest Common Prefix) respectively. However, I keep getting TLE, as the time limit is too tight and they don't use optimization flags to compile on this site.

Notice that this problem is also available on LiveArchive. I got AC there using Hash or Aho-Corasick and even managed to be among the top solutions. However, apparently there is a much faster way of solving this problem. Could anyone help me with other ideas?

Thanks!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится