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

Автор purple_dreams, история, 7 лет назад, По-английски

My solution click to this hackerrank problem click

I use trie policy data structure but it is tle since distance operator is O(n) ... any help how to implement using it or it is not possible?

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

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

I am surprised this is getting so many downvotes, perhaps the question isn't very clear and seems confusing for people not familiar with the policy based structures.

Overloading std::distance does the trick. See http://mirror.codeforces.com/blog/entry/10355?#comment-163713