← All problemsSign in

Mathison and the cubic tree

CodeChefRating 3276Open on judge ↗

After playing board games, buying letters, and shuffling decks, Mathison has finally decided to study. He opens his favorite book, CLRS, and decides to solve a graph problem. The problem is described below and you can find it by its number, 25.1-11, on page 693 (3rd edition only). You are given a tree with N nodes where each node has a value associated with it. Define PROD(u, v) to be the produc

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