{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"给定一棵 n 个点的带权树,定义树上一条路径的长度为**路径上所有边权的异或和**,求树上最长路径的长度。"}},{"title":"Input","value":{"format":"MD","content":"第一行一个整数 n,接下来 n - 1 行每行三个整数 u, v, w,表示 u, v 之间有一条权值为 w 的边。\n(1 \u003c\u003d n \u003c\u003d 1e5, 1 \u003c\u003d u, v \u003c\u003d n, 0 \u003c\u003d w \u003c 2^31)"}},{"title":"Output","value":{"format":"MD","content":"输出一行一个整数,表示答案。"}},{"title":"Sample Input","value":{"format":"MD","content":"4\n1 2 3\n2 3 4\n2 4 6"}},{"title":"Sample Output","value":{"format":"MD","content":"7"}}]}