强行把序列问题放树上,好无聊啊~ code: #include <bits/stdc++.h> #define N 200005 #define setIO(s) freopen(s".in","r",stdin) using namespace std; int tot,edges,tim; int cnt[N*33],ch[N*33][2],tree[N],seq[N],val[N],ba[N]; int fa[N],son[N],size[N],t…
Query on A Tree Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 712 Accepted Submission(s): 266 Problem Description Monkey A lives on a tree, he always plays on this tree. One day, monke…