Friends Meeting
Chef and his friend John have not see each other for years. They are both are looking forward to meeting again in the city they both grew up in. The city has N public squares that they can meet in. The squares are numbered from 1 to N and are connected with N-1 roads. Each road has its own length It is known that between two squares there is exactly one path that goes through the roads and squar
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