Smartly Connected States
CodeChefOpen on judge ↗
As a part of smart India Project the prime minister of LaLaLand Mr Narendra Lodi is connecting states in his country. The country of LaLaLand consists of N states. There are Y railway track and X roads between these states. A state A is said to be smartly connected to another state B if we can travel from state A to state B by using only roads and also by using only railways. Now our
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