Alice is given a tree withnnnnodes indexed from111tonnn. Each edge on the tree can be either black or white, and all edges are initially white.Note that a simple path is a path between two nodes that does not visit any node more than once.
Alice is given a tree with nnn nodes indexed from 111 to nnn. Each edge on the tree can be either black or white, and all edges are initially white. There are three kinds of operations: 1. Change the color of an edge to black. 2. Change the color of an edge to white. 3. Given a node index, count the sum of the number of black edges on the simple path from all odd-indexed nodes to that node. Note that a simple path is a path between two nodes that does not visit any node more than once.
标签: HBC252105MinimumSpanningTree 图论 生成树 数据结构 树The Number Of Black Edges题解