-
Notifications
You must be signed in to change notification settings - Fork 2
dsu on tree
phonism edited this page Nov 10, 2020
·
3 revisions
-
Lomsat gelral:https://codeforces.com/problemset/problem/600/E ⭐⭐⭐
- 题意:给一颗有根树,每个节点有颜色,问每个节点的子树颜色最多的颜色和是多少?
- 题解:维护map<color, cnt>,max[N], cnt[N]等,然后启发式合并每次更新的时候更新结果。
- 代码: