← All problemsSign in

MinPath Minimize

CodeChefRating 2186Open on judge ↗

**This problem has the same setup and definitions as MINMEXSUM. However, they differ in what needs to be computed, as well as the constraint on $N$.** Consider a tree on $N$ vertices, with vertex $u$ having value $A_u$ written on it. We have the following definitions: - For two vertices $u, v$, define $P(u, v)$ to be the set of vertices on the unique simple path from $u$ to $v$ in the tree.

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