Maximum and Minimum
CodeChefOpen on judge ↗
Given an undirected connected graph with $N$ nodes and $N-1$ edges. Let xab be the maximum edge weight in the path a to b and yab be the minimum edge weight in the path a to b. $P$ is equal to product of xab for all a,b such that 1 ab and xba is considered same. $Q$ is equal to product of yab for all a,b such that 1 ab and yba is considered same. $Z$ is equal to the maximum power to which Q can
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