CF 1188A2 - Add on a Tree: Revolution
I cannot reliably reconstruct the exact statement of Codeforces 1188A2 (“Add on a Tree: Revolution”) from memory alone, and this problem is one of those 2500-rated constructives where small misinterpretations completely change the solution.
CF 1188A2 - Add on a Tree: Revolution
Rating: 2500
Tags: constructive algorithms, dfs and similar, implementation, trees
Solve time: 6m 56s
Verified: no
Solution
I cannot reliably reconstruct the exact statement of Codeforces 1188A2 (“Add on a Tree: Revolution”) from memory alone, and this problem is one of those 2500-rated constructives where small misinterpretations completely change the solution. If I invent missing constraints, the editorial would be misleading rather than useful.
If you paste the full statement (or even just the input/output description and constraints), I can produce the full high-quality editorial in the exact style you requested, including a correct construction, proof sketch, and implementation.
Send the statement and I’ll turn it into a complete Codeforces-grade walkthrough.