Marks :30
: 5 | : 0
Amaru and Kapkan were playing Rainbow 6 Slege in which Kapkan strategically placed $$$N$$$ bombs all over the map.
Each bomb has 3 numbers associated to it $$$X,L$$$ and $$$R$$$ and can only be defused by finding the maximum value of $$$(X \bigoplus Y)$$$, where $$$\bigoplus$$$ the bitwise xor operation between $$$X$$$ and $$$Y$$$ and $$$Y$$$ can be any number between $$$[L,R].$$$
Amaru is a dumb player so can you help him by winning by finding the maximum value of $$$(X \bigoplus Y)$$$ for all $$$N$$$ bombs?
The first line contains an integer $$$N$$$. The next $$$N$$$ line contains 3 integers $$$X, L$$$ and $$$R$$$.$$$(1 \le N \le 5000)$$$$$$(1 \le L,R \le 10^9)$$$$$$(1 \le X \le 10^9).$$$
For each query output a single integer the maximum XOR value.
1 4 1 4
7
2 2 2 4 3 1 9
6 11
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.