Utkarsh Lost in Cities
CodeChefOpen on judge ↗
Problem Description Utkarsh has come to a new country having N cities(numbered from 1to N). There are M directed roads in the country each of length 1 unit . Utkarsh is very lazy so he cannot walk more thanK units. He has Q queries. Each query is of the form a b . For each query he wants to know how many different paths (of positive length ) are there from city a to b which Utkarsh can walk. Ou
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