Jorge_Slime's blog

By Jorge_Slime, history, 2 months ago, In English

I tried to solve this problem: https://vjudge.net/problem/UVA-13139
and here is my implementation: https://paste.myst.rs/cc9vzvcn

Honestly, I don’t struggle with implementing a standard segment tree, but when it comes to range updates, it gets challenging. If anyone could help me or provide some problems, implementations, or resources to identify my error, I would greatly appreciate it. Thanks in advance!

  • Vote: I like it
  • -10
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

You can see an HLD + Lazy Seg implementation of mine here: https://pastebin.com/ZLPaytVD

If you're struggling with range updates, I recommend taking some time tackling straight-forward questions like this one https://cses.fi/problemset/task/1735 to really digest the logic behind the algorithm.

Also, this one https://cses.fi/problemset/task/2134 is about HLD without lazy prop and might also be helpful