hdu6324专题

HDU6324 Problem F. Grab The Tree(2018HDU多校联赛第三场,博弈)

Problem Description Little Q and Little T are playing a game on a tree. There are n vertices on the tree, labeled by 1,2,…,n, connected by n−1 bidirectional edges. The i-th vertex has the value of w