← All problemsSign in

Magic Graph

Digo loves graphs. He defines a super-connected graph as a graph having N nodes, such that for any j, 1jN-1, it is possible to reach from node 1 to node j without crossing nodes j+1 to N. The magician Gogo has decided to take over the world. The only man who stands between him and total world annihilation is Digo. Gogo knows that Digo does not stand a chance against his magical skills. He however

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