Avoid Tolls
CodeChefOpen on judge ↗
Sinchan lives in chefland and loves to visit the houses nearby. There are N houses in city numbered from 1 to N, he lives in house 1. These houses are connected to each other by network of N-1 road, also Sinchan knows another set of N-1 roads which leads to his house from any house. Each road is one way and has unique id labeled from 1 to 2*N-2. Now for naughtiness of Sinchan he has to pay certain
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