CP Kingdom
CodeChefOpen on judge ↗
There exists $N$ cities in a kingdom. You're also given the roads $R$ between the cities of the kingdom where $R_{ij}$ depicts a road between City $i$ and $j$. In each step, a citizen travels from the city they’re presently in to another city using the road between the 2 cities. The roads are labelled with integral values. If a city is connected to 2 other cities, with the roads labelled as 4 and
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