Comments

Thank you so much for your explanation. And your English is good. :D

I have a confusion. The editorial for problem D says that, for a certain tree structure, a particular node can have ONLY two possible values of cnt which is why we only need to work with a certain node for 2 times and save it in a memory because we might encounter the same state later. So according to the solution provided, for a certain node i, answer[i] is a vector which has size not more than 2. right? If so far what i understood is true, how can i logically prove that there are only two possible values of cnt for a certain node? Is there an intuitive way to prove this?

So I get to reach my max rating with a 105+ in this contest and then wake up in the morning to see this? (sighs...)

0

That's right. I faced the same issue yesterday. I wonder why many people are not talking about it yet.