RMI 2014 — Minxor

Revision en2, by radoslav11, 2016-02-10 17:59:59

Hello!

I was solving problem Minxor from second day of RMI 2014. In short the problem is:

You have 3 types of queries.

1 x -> inserts x into the set
2 x -> deletes x from the set
3 -> asks for the smallest xor of any two numbers in the set

I solved the problem offline using a trie + divide and conquer. My solution is similar to link. Again in short: compressing all updates as "number x appears from time I to time J". Here is the code. The complexity is O(M * log(M) * 32);

So my question is:

Is there a solution which runs faster than that or/is online. Thanks in advance :)

Tags xor, trie, rmi, problem

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English radoslav11 2016-02-10 17:59:59 29
en1 English radoslav11 2016-02-10 17:59:18 756 Initial revision (published)