Binod and Query
CodeChefOpen on judge ↗
A tree can be defined as an undirected acyclic graph, with nodes numbered from $1$ to $N$. In this problem, the tree is always rooted at $1$. The Node $i$ has a value $V_{i}$. Binod has $Q$ queries, each query has two number $X$ and $Y$. For each query, you need to start from the Node $X$ and jump up the tree by $Y$ levels collecting values at each node visited until there are not $Y$ levels r
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