← All problemsSign in

Exclusive Cities

Vicky plans to visit Vickyland. Vickyland is a strange state where a city can be connected either by roads to one or more cities(including itself) or can be completely isolated from other cities. While examining the map of Vickyland a very strange and interesting idea came to his mind. He defines 2 cities A and B to form an exclusive pair of cities if and only if for every other vertex C, either A

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