USACO Superbull(Silver) Help

I’m currently working on the 2015 Silver problem ‘Superbull’. I know that the problem is related to trees/graph theory/the like, but I can’t fully connect the dots. This is what I’ve got so far:

 For my algorithm, I'd first calculate all XOR values of all possible pairs of teams. 
 I could then use these values to create a kinda graph, tree, etc?

I’ve tried continuing from here, but it feels like I’m going into a dead end.
I don’t want to reveal the solution to myself quite yet, as that would ‘waste’ some practice. Could somebody give a hint on this problem? Thanks in advance.

Hint: Greedy Algorithm (hope i didn’t give away too much)

2 Likes

This problem is a standard MST problem, I would suggest you to go through the graph section in gold. (maybe greedy works as well, but MST is easier)

1 Like

MST is a type of greedy algorithm :stuck_out_tongue: