shimak's blog

By shimak, history, 2 weeks ago, In English,

This is a very standard problem on Trie regarding range query. https://www.codechef.com/problems/MCO16404 What I always see is that while using a Binary Trie for range query, we store a vector in the trie structure to keep track of the position of the number to which a particular bit belongs. Now I was thinking(with respect to the above question) if it was possible to return the index of the element where the xor becomes maximum. Is it actually possible using a trie or do we need some other logic? Any help is appreciated.

 
 
 
 

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Is this gonna help solving BINSTR from current contest??

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

( ° ͜ʖ °) Tries

you can add it as an extra variable in your trie while defining the struct maybe, so at the endpoint of a node, it can store what the number it belongs to is