>Link
ybtoj最大异或对
>解题思路
因为是 异或,所以显然我们要先把数都拆成二进制,放进字典树中
根据题目大意:找出两两异或出的最大值,所以我们要考虑数尽可能大,显然我们要优先考虑高位数,也就是从高位往低位的顺序构建字典树
然后我们枚举每一个数,“走反路”就行了(异或:相同为0,不同为1。所以假设当前位为1,我们就选择0,如果0这条路不存在,我们就只好选择相同的数1)
>代码
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define N 100010
#define LL long long
using namespace std;
int n, k, p, sum, ans;
LL maxn, l[50], a[N], b[N], cnt, t[40 * N][5]; //数组要开大!!!!!
int main()
{