Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Contest 2-A: Backup Network

โญ beginnerโณ 40 min read๐Ÿ“ Lesson 193 of 281

Mock contest 2, problem A: second-best MST via Kruskal + cycle replacement. Target: solved within 40 minutes.

Contest 2-A โ€” Backup Network. Second-best spanning tree: Kruskal for the MST, then for every non-tree edge replace the maximum tree edge on its cycle. Graded near-miss: descending sort = maximum spanning tree.

Contest 2-A. The wrong version inverts the sort direction and reports the heaviest spanning tree โ€” a one-character bug with a completely different meaning.