← All problemsSign in

D-Dimensional MST

CodeChefRating 2399Open on judge ↗

You are given $N$ points in $D$-dimensional space. The $i^{th}$ point has $D$ coordinates - $x_{i, 1}, x_{i, 2}, \ldots, x_{i, D}$. Consider a weighted undirected complete graph with these $N$ points as its vertices. Weight of the edge between points $i$ and $j$ is $|x_{i,1} - x_{j, 1}| + |x_{i,2} - x_{j, 2}| + \ldots + |x_{i, D} - x_{j,D}|$. Find the weight of the [maximum spanning tree](ht

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