October Long Challenge Bacterial Reproduction Question Help

Can someone explain how to solve the question.
Link - https://www.codechef.com/OCT19A/problems/BACREP

I thought of something using DP on trees but the update queries didn’t make it possible for me.

2 Likes

Too many threads on this XD

BACREP - “Bacterial Reproduction” - heavily-documented code; Editorial-style overview.

2 Likes

thank you. A great problem so everyone wants to learn.

1 Like