BZOJ1954 Pku3764 The xor-longest Path
The input contains several test cases. 虽然我没看到这句话但也A了,什么情况。 a到b的路径xor=(a到根xor b到根) 水 #include <cstdio> #include <cstring> #include <algorithm> using namespace std; struct edge { int t, v; edge *next; }; const int maxn = 100009; const int maxl = 33; int n, v[maxn], fa[maxn], tr[maxn * maxl][2], tn; edge *head[maxn], *ep; inline void addEdge(int u, int v, int w) { ep-> t = v; ep-> v = w; ep-> next = head[u]; head[u] = ep ++;...