← All problemsSign in

The Minimum Game

CodeChefRating 2782Open on judge ↗

Alice and Bob have invented a new game. They have a rooted tree having $N$ nodes (rooted at node $1$), and the $i^{th}$ node has the value $A_i$ associated with it ($1$-indexed). The value associated with the root node is $0$. They start with a marker at the root node, and a score of $0$. Alice and Bob moves alternatively, with Alice moving first. In one move, they can move the pointer from a nod

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