Please read the new rule regarding the restriction on the use of AI tools. ×

Help needed to solve this problem of DP + DSU

Revision en1, by 10pullupsin2019, 2016-06-21 19:49:40

I'm stuck with this problem

I've not found any blog or editorial on it and I couldn't understand the solution by reading a code. Can anyone please explain how to solve this problem in a few words?

Tags dp, dsu

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English 10pullupsin2019 2016-06-21 19:49:40 357 Initial revision (published)