← All problemsSign in

Delta wants treats

Delta, the dog, loves to have treats. Delta lives in a city with $N$ buildings numbered $1 to N$, $M$ of which have treats. Also, there are $P$ roads connecting these buildings. Each road connects a Building $R$ to a Building $S$. Delta is currently at a building $A$ and wants to go to building $B$. If he visits a building which does not have a treat, he will become sad. Delta wants to reach his d

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