河南理工大学新生挑战赛 C.Xor Path
河南理工大学新生挑战赛 C.Xor Path 题目描述 In graph theory, if an undirected gragh G(V, E) without cycle has n vertices, n − 1 edges and the graph is connected, then G(V, E) is called a tree. You are given a tree has n vertices, each vertice has a weight. Vertice i’s weight is w i w_i w i . Henry has q queries, each query has two vertices u, v. He wants to know the xor sum of the weights of all vertices on the shortest path from u to v (contains u,v). 输入描述: The first line is an integer n ( 1 ≤ n ≤ 1 0 5 ) n (1 ≤ n ≤ 10^5 ) n ( 1 ≤ n ≤ 1 0 5 ) , the number of the vertices. Line 2 has n integers , the ith