当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

BZOJ1954:Pku3764 The xor-longest Path

题目描述
给定一棵n个点的带权树,求树上最长的异或和路径
输入解释
The input contains several test cases. The first line of each test case contains an integer n(1<=n<=100000), The following n-1 lines each contains three integers u(0 <= u < n),v(0 <= v < n),w(0 <= w < 2^31), which means there is an edge between node u and v of length w.
输出解释
For each test case output the xor-length of the xor-longest path.
输入样例
4
1 2 3
2 3 4
2 4 6
输出样例
7
提示

The xor-longest path is 1->2->3, which has length 7 (=3 ⊕ 4)
注意:结点下标从1开始到N....

BZPRO Powered by Remmina.
Github Repository
来自acmore.cc的附加信息
bzoj_id 1954
import_source_sha256 8ccb86ce775ec028d1d6b716c34c2a844befed5e384ab792780df08a184f455e
bzoj_checker_pending False

该题目包含在题集 大视野(八中)OJ 中

题目来源 BZOJ 1954

源链接: LOCAL-BZOJ1954

共提交 0 次

通过率 --%
时间上限 内存上限
1000 MS 64 MB