← All problemsSign in

Thathas lineage

Thatha has a family tree which he created with a lot of hard work. In the given tree he wants to find out the effort put in by a person to expand the tree. $k$-effort of a person $v$ is defined as the number of distinct names among the $k$-children of $v$. A person $u$ is called a $k$-child of another person $v$ if $u$ is $k$-levels below $v$. Thatha wants to find the effort of $Q$ people i

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