the following is my solution, the problem is just the problem at cf,http://codeforces.com/problemset/problem/282/E, i think they are same, sorry for my bad english.

```
struct node{
int next[2];
node() {
next[0] = next[1] = 0;
}
};
class Solution {
public:
void add(vector<node*> &v, int x) {
int u = 0;
for (int i = 31; i >= 0; i--) {
int cur = (x & (1 << i)) > 0;
if(!v[u]->next[cur]) {
node *t = new node;
v[u]->next[cur] = v.size();
v.push_back(t);
}
u = v[u]->next[cur];
}
}
int work(vector<node*> &v, int x) {
int res = 0;
int u = 0;
for (int i = 31; i >= 0; i--) {
int cur = (x & (1 << i)) > 0;
if(v[u]->next[cur ^ 1]) {
u = v[u]->next[cur ^ 1];
res |= (1 << i);
} else {
u = v[u]->next[cur];
}
}
return res;
}
int findMaximumXOR(vector<int>& nums) {
int num = 0;
vector<node*> v;
node *root = new node;
v.push_back(root);
int n = nums.size();
for (int i = 0; i < n; i++) add(v, nums[i]);
int res = 0;
for (int i = 0; i < n; i++) {
res = max(res, work(v, nums[i]));
}
return res;
}
};
```