Help , ATCODER 183 , F (Adv. Data structure)

hello ,
Problem : F - Confluence
I know this problem is using dsu on trees I am not able to get the code (O(nlogn))mentioned in this blog. : [Tutorial] Sack (dsu on tree) - Codeforces
Can anyone please help we better resources ??
And What is Small - Large Merge ??
@galencolin @first_semester @cubefreak777 @carre @sebastian

there’s no tree here, is just disjoints sets.

When you make merge operation just add the itmes of the smaller to the items of the larger one

1 Like

how to get number of Ci in subtree ? can you please share a resource?

I insist, there’s no tree. You just need to find the number of c[i] of the corresponding set, you must read about disjoints sets

1 Like

ohhk. Thank you