Disjoint Set Union (DSU)
If you're learning DSU for the first time, I recommend solving them in the following order:
- 755C - PolandBall and Forest — my solution(381760852)
- 217A - Ice Skating — my solution(381800055)
- 445B - DZY Loves Chemistry — my solution(382353172)
- 1263D - Secret Passwords — my solution(381810414)
- 939D - Love Rescue — my solution(381830505)
- 1012B - Chemical table — my solution(384865311)
- 1167C - News Distribution — my solution(388674692)
- 1249B1 - Books Exchange (easy version) — my solution(382086807)
- 893C - Rumor — my solution(394841571)
- 277A - Learning Languages
- 25D - Roads not only in Berland — my solution(382417740)
- 1609D - Social Network — my solution(382447487)
- 1559D1 - Mocha and Diana (Easy Version)
- 1559D2 - Mocha and Diana (Hard Version)
- 292D - Connected Components
- 891C - Envy
- 1618G - Trader Problem
- 920E - Connected Components?
Remaining answer i will add shortly.
Tip: Don't solve these problems by simply memorizing the DSU template. Before coding, always ask yourself:
- What do the sets represent?
- When should two sets be merged?
- What does the representative of a set signify?
Once you can answer these questions, identifying DSU in future graph problems becomes much easier.









Obligatory shameless plug for my full proof writeup https://codeforces.me/blog/entry/154298
Learnt a lot from this one
You could just post a link to the chatgpt convo