Not So Random Walks
CodeChefOpen on judge ↗
Chef found a rooted tree with $N$ nodes. The nodes are labeled from $1$ to $N$. Node with label $1$ was marked as the root. $R$ is the adjacency list representing the tree, which includes only children, but not the parent of every node. Denote $K(i)$ as the number of children of the $i^{th}$ node. Denote $R(i, j)$ as the $j^{th}$ child of the $i^{th}$ node ($0 \leq j < K(i)$). Chef also found th
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