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

Автор Living_Tribunal, история, 4 года назад, По-английски

This question appeared in a contest on hacerrank.

Any ideas on how to solve this tree problem efficiently? I got only 57.14 points with my binary search and preorder-pattern matching approach.

Here's my approach

I'm asking for your help and approach because no submissions are available to see.

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

»
3 года назад, # |
  Проголосовать: нравится -17 Проголосовать: не нравится

SecondThread orz Errichto please help with this. I know red coders are busy and shouldn't tag them, but I need help and this problem seems tough. If you think it's too easy, just tag someone else (like yellow maybe).

Here's what I've tried:

  • Even I've solved the O(n^2 log N) thing using binary search.

  • I also tried serializing the tree and using suffix automaton to solve the longest duplicate substring on it, but seems like it won't work.