
dsu on tree
coldfresh
那我们开始吧
展开
-
【Codeforces-600E】Lomsat gelral(dsu on tree)
You are given a rooted tree with root in vertex 1. Each vertex is coloured in some colour.Let’s call colour c dominating in the subtree of vertex v if there are no other colours that appear in the su...原创 2019-04-16 20:06:08 · 198 阅读 · 0 评论 -
【Codeforces-741D】Arpa’s letter-marked tree and Mehrdad’s Dokhtar-kosh paths(dsu on tree)
套dsu on tree的套路代码:#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>#include<cmath>#define ll long long#define maxx 500005#define INF 0x7f7f...原创 2019-04-17 13:42:23 · 430 阅读 · 0 评论 -
【Codeforces-208E】Blood Cousins(dsu on tree+离线)
Polycarpus got hold of a family relationship tree. The tree describes family relationships of n people, numbered 1 through n. Each person in the tree has no more than one parent.Let’s call person a a...原创 2019-04-17 15:59:48 · 305 阅读 · 0 评论