Description You are given a tree (an acyclic undirected connected graph) with n nodes. The tree nodes are numbered from 1 to n. Each node has a color, white or black. All the nodes are black initially. We will ask you to perfrom some instructions of
题意:给你一棵树,一开始每个点上的颜色互不相同.三种操作:op1:x到根的路径上的点都染上一种新的颜色.op2:设一条路径的权值为val(x,y),求x到y路径的val.op3:询问x的子树中最大的到根路径val.n<=1e5. 标程: #include<bits/stdc++.h> using namespace std; typedef long long ll; ; ; int f[N],prime[N],tot,F[N],ans,p[N],n,m,nxt,u[N],fi[N];