L - Yet Another MST Problem
CodeChefOpen on judge ↗
You are given a connected undirected graph $G$ with $N$ nodes and $M$ edges. Each edge has weight $1$. Some nodes are marked, and the other nodes are unmarked. You are given a binary string $S$ where $S_i = 1$ if and only if the node $i$ is marked. Let $X$ be the set of the all marked nodes. It is guaranteed that $X$ is non-empty. Construct a complete weighted graph $H$ on the subset $X$. The w
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.
Sign in to chat with the tutor and save your progress.
Sign in to start