Trees · Dynamic Programming

Lesson 4

Nikolai Chukhin · Alexander S. Kulikov

Problem. After the previous party, you decided to take a different approach: now, for each person, you know their “fun index”, and instead of maximizing the number of invitees, you want to maximize the total fun index. What will it be for the tree below? (More formally: what is the weight of the heaviest independent set in this tree?)

5 points