DCEPC13C - Alien Invasion
Aliens have invaded the Earth. Now it is the responsibility of DCE Coders to stop this invasion. Aliens interact with each other using encrypted messages which consist of numbers.
Now you have to find the key to decipher the messages. The key is actually the minimum xor of any two numbers in the message.
Given a single message, You have to find the key fast to know the aliens strategy and save Earth. Can you help them find the key ?
Input
N (2 ≤ N ≤ 100000)
a1 a2 a3 ... aN
0 ≤ ai ≤ 109
Output
The minimum XOR in single line.
Example
Input: 3 1 2 3 Output: 1
hide comments
nadstratosfer:
2018-09-13 21:57:24
Could use a bigger dataset -- got 0.00s with O(nlogn) despite O(n) being possible. |
Added by: | dce coders |
Date: | 2015-03-08 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 JS-MONKEY |