Torque and edges
CodeChefOpen on judge ↗
Torque and Egdes Torque (Yes! we don't have Chef today :P), the scientist is performing weird experiment on a tree. His tree contains N vertices and N-1 edges. Each vertex has some integer score associated with it. During his experiment, Torque can delete any edge from tree. This results in two connected components. Now, he will discard one component and keep the other component with him. He may
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