purple_dreams's blog

By purple_dreams, history, 7 years ago, In English

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?

  • Vote: I like it
  • +6
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it +3 Vote: I do not like it

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