思路:
我们可以先预处理出1~i的异或路径是多少,然后在他们中选两个异或最大的
这样就转化成了最大异或对
c o d e code code
#include<iostream>
#include<cstdio>
using namespace std;
int n, head[100010], tot, a[100010];
int trie[3000010][2];
struct node
{
int to, next, w;
}b[200010];
void add(int x, int y, int z)
{
b[++tot]=(node){
y