Standard Tree Task
There's no story in this problem, it's time for trees! The company structure of ShareChat can be viewed as a tree with $N$ nodes (numbered $1$ through $N$); node $1$ is the root of this tree. You should choose a (possibly empty) subset of nodes and place one coin in each node from this set. We call the tree *proper* if the following condition holds: - Consider two arbitrary disjont subtrees. Let'
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