CISCO
CodeChefOpen on judge ↗
There is a tree $T$ with $N$ vertices, numbered $1$ through $N$. For each $1≤i≤N−1$, the $i-th$ edge connects vertices $ai$ and $bi$. Cisco is constructing a directed graph $T'$ by arbitrarily assigning direction to each edge in $T$. (There are $2N−1$ different ways to construct $T'$.) For a fixed $T'$, we will define $d(s, t)$ for each $1≤s$, $t≤N$, as follows: $d(s, t)$=(The number of edges t
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