Query whether path between two nodes in a tree contains a given value
问题 Suppose a tree has N nodes connected by N-1 edges, where 1 < N < 10^5. The nodes are numbered from 1 to N, and each node holds a value, which is also number in the range 1 to N; the values are unrelated to the node numbers, and are not necessarily distinct. The tree is not necessarily balanced. Because it is a tree, we know there is only one path between any two nodes. Then, we are given M queries, where 1 < M < 10^5. Each query gives two nodes, A and B, and a value T. For each query we have