The xor-longest Path Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10038 Accepted: 2040 Description 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: ⊕ is the xor operator. W…
We know that the longest path problem for general case belongs to the NP-hard category, so there is no known polynomial time solution for it. However, for a special case which is directed acyclic graph, we can solve this problem in linear time. First…
We all know that the shortest path problem has optimal substructure. The reasoning is like below: Supppose we have a path p from node u to v, another node t lies on path p: u->t->v ("->" means a path). We claim that u->t is also a sh…
The xor-longest Path Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 6455 Accepted: 1392 Description 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: {xor}length(p)=\oplus{e \in p…
链接:http://poj.org/problem?id=3764 题面: The xor-longest Path Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 11802 Accepted: 2321 Description In an edge-weighted tree, the xor-length of a path p is defined as the xor sum of the weights o…