← All problemsSign in

Interactive MST

CodeChefRating 3146Open on judge ↗

There is a hidden **undirected connected** graph $G$ with $n$ nodes and $m$ edges numbered $0, 1, \ldots m - 1$, and a hidden permutation $p_0, p_1, \ldots, p_{m-1}$ of edges. The graph doesn't contain any self loops or multiple edges. You only know the value of $n$ and $m$. You can ask queries. In one query, you give the judge a vector $w = [w_0, w_1, \ldots, w_{m-1}]$ of size $m$ consisting 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