Persistent Centroid Tree

I have described about Centroid Decomposition in my earlier blog post (original @ quora). I had authored a problem on codeforces which involves a nice reduction of making the centroid tree persistent, which enables us to perform more powerful operations in sublinear complexity. I call the trick Persistent Centroid Tree. This article is to give some visibility to the problem and the trick explained by me in the editorial of the problem.  The links to the problem and the editorial are given below.

Problem: https://codeforces.com/contest/757/problem/G

Editorial & Explanation: https://codeforces.com/blog/entry/49743

If you have seen problems that require a similar trick, or can be solved more efficiently using this trick, please comment below and I’ll create a list here.

Happy Coding!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s