In an edge-weighted tree, the xor-length of a path p is defined as the xor sum of the weights of edges on p: xorlength=⊕e∈pw_{xor}length=oplus_{e in p}wxorlength=⊕e∈pw ⊕ is the xor operator. We say a path the xor-longest path if it has the largest xor-length. Given an edge-weighted tree with n nodes, can you find the xor-longest path?
In an edge-weighted tree, the xor-length of a path p is defined as the xor sum of the weights of edges on p: xorlength(p)=⊕e∈pw(e)_{xor}length(p)=oplus_{e in p}w(e)xorlength(p)=⊕e∈pw(e) ⊕ is the xor operator. We say a path the xor-longest path if it has the largest xor-length. Given an edge-weighted tree with n nodes, can you find the xor-longest path?
(图片来源网络,侵删)
标签: HBC50994ProblemJ:JeopardisedJourneyThe xor-longest Path题解