← All problemsSign in

Defeating Beerus

CodeChefRating 2728Open on judge ↗

Kakarot and Vegeta are both training their sons Goten and Trunks as only they can defeat Beerus. To train them, Kakarot lays out an undirected **graph** where each node is connected to every other node (even to itself). Each node also has a weight, which is hidden. The weight on node i is $node_i$. For Goten, the time taken to jump from one node to another is $node_1$ OR $node_2$ (OR is the bitwi

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start