NeverSpot's blog

By NeverSpot, history, 3 weeks ago, In English

Hey Red Coders,

Recently, I have been trying to solve all the problems in the CSES tree section, but even after trying many things, I have failed to solve the last two problems. After searching for solutions, I learned that they can be solved using Centroid Decomposition.

I read some blogs and watched videos on YouTube, but I still can’t grasp the logic. Although I could pretend to understand it and copy paste code to complete the CSES section, I genuinely want to learn and understand why and how it works so that I will be able to solve questions based on it in the future.

I would greatly appreciate it if anyone is willing to explain it to me and help build my intuition around it.

Resources I have tried( although they are really great, but due to my limited knowledge I am not able to grasp the logic):

USACO guide Centroid section

Blog by Tanuj Khattar

Video by Colin Galen

Video by Gaurav Sen

Full text and comments »

  • Vote: I like it
  • +14
  • Vote: I do not like it