Deal at Vormir
CodeChefOpen on judge ↗
Black Widow and Hawkeye have reached Vormir to obtain the Soul Stone. After some negotiation, they strike a deal that if they are able to solve one of Red Skull's problems, then no sacrifice is required for the Soul Stone. You are given a tree (an undirected acyclic graph) of $n$ vertices, with each node i having a value $A[i$]. The tree is rooted at node $1$. For each node find the minimum and
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