Bob and his problem
CodeChefOpen on judge ↗
Bob likes trees and XOR (Exclusive OR) very much. So he created a tree with each edge having a weight associated with it. One day his friend Alice came to his house, after playing video games for some time they got bored and decided to play something else. Bob showed the tree to Alice and told her that given any 2 vertices in the tree he can tell the XOR of all the weights on the unique path join
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