Practice · 2 of 3
Condensation Edge Count
CHALLENGE
Difficulty: advanced+25 XP
**Bài toán.** Line 1: n m; then m directed edges u v. Print one number: the number of DISTINCT edges in the condensation DAG — pairs (comp[u], comp[v]) with comp[u] != comp[v], counted once each. **Constraints:** 1 ≤ n, m ≤ 200 000. Kosaraju + a set of pairs. Counting raw crossing edges fails on duplicates.
Press Submit to check your solution.
Back to lesson: Practice: SCC Trio