← All problemsSign in

Rooted Minimum Spanning Tree

CodeChefRating 2642Open on judge ↗

You are given a weighted simple undirected graph with $N$ vertices, which are numbered from $1$ to $N$. You are guaranteed that vertex $1$ is not an articulation point (which means that even after removing the vertex $1$, the remaining graph is connected) and has an edge connecting it to each of the other $N-1$ vertices. For each $K \in \{1, 2, \ldots, N-1\}$ you need to find the minimum weight o

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start