Max Value of MST
CodeChefOpen on judge ↗
Yash gave Swar $2$ integers $N$ and $M$, and an integer array $A$ of size $M$. Swar has to consider all undirected weighted graphs $G$ such that: - $G$ has $N$ vertices and $M$ edges - $G$ is simple, i.e, there is at most one edge between any pair of its vertices and it doesn't contain self-loops - The weights of the edges of $G$ are exactly the array $A$ Among all these graphs, Swar has to find
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