← All problemsSign in

Chef and hospitals

There is a city which has $N$ landmarks and $M$ roads connecting them. All the roads in this city are one way. (But it is possible for a road to exist from A to B as well as from B to A). Out of these $N$ landmarks , there are $K$ landmarks which are **Hospitals**. However there is a possibility that due to roads being **unidirectional** , some landmarks are not reachable from the hospital. Suc

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