Skip to main content

Practice · 8 of 8

Growing Network

CHALLENGE
Difficulty: advanced+25 XP

**Tình huống.** n ≤ 200000 computers, m ≤ 300000 link events in chronological order, each adding one connection. After each event, report the number of connected components. **Thuật toán nào phù hợp nhất? Chương trình chỉ cần in ra chữ cái.** **A)** Run BFS after every event **B)** DSU with union-by-size; components = n minus successful unions **C)** Kruskal, then binary search each query **D)** Sparse table over events

Back to lesson: Practice: Recognition Drill Set 1