Entertainment
G. Unusual Entertainment
G. Unusual Entertainment A tree is a connected graph without cycles. A permutation is an array consisting of $n$ distinct integers from $1$ to $n$ in ......
CF1899 G Unusual Entertainment 题解
Link CF1899 G Unusual Entertainment Question 给出一个排列 \(p_i\) 和一棵树,给出 \(Q\) 组询问,每组询问 \([L,R,x]\) 表示求 \(p_L \sim p_R\) 上是否存在 \(p_i\) 在 \(x\) 的字数上。 Soluti ......
cf1899G. Unusual Entertainment(启发式合并)
https://codeforces.com/contest/1899/problem/G 首先将将节点重新映射一下 然后就是个启发式合并板题 #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #includ ......