POJ3237 Tree

题目:

You are given a tree with N nodes. The tree’s nodes are numbered 1 through N and its edges are numbered 1 through N − 1. Each edge is associated with a weight. Then you are to execute a series of instructions on the tree. The instructions can be one of the following forms:

CHANGE i v Change the weight of the ith edge to v
NEGATE a b Negate the weight of every edge on the path from a to b
QUERY a b Find the maximum weight of edges on the path from a to b

这题同样需要将边权转换成点权。
题目链接
另一道需要将边权转换成点权的题

 

点赞

发表评论

您的电子邮箱地址不会被公开。