Roads and Cycles
CodeChefOpen on judge ↗
There are $N$ cities numbered from $1$ to $N$. There are zero or more bidirectional routes between every pair of cities. There are total $M$ roads in the city. Each road has some cost associated with it. You are given an integer $X$ and two cities $A$ and $B$. Find the number of simple routes between cities $A$ and $B$ having cost less than or equal to $X$. A simple route is one which does n
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