NetHunter's blog

By NetHunter, history, 16 months ago, In English

Seeing tree problems with long problem statements and diagrams the first thought that comes to mind is "Oh no, here comes more work, but I have to tackle it for any hope of getting better at CP."

I'm currently working on this : https://mirror.codeforces.com/contest/1843/problem/D

Leave a comment on some of the best tree problems you've worked on. How easy/difficult it was to solve? What was the crux move/idea? ...

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

»
16 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Most problems on trees follow the same logic: Do a dfs starting at the root; solve for the children then solve for the current vertex. Just practice and you will get good at then; personally, I think tree problems are one of the most “reliable” class of problems, as they rarely deviate from that pattern at lower levels

»
16 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

One of the hardest one I solved

The main idea was combining MO's algo with ETT