zscoder's blog

By zscoder, history, 9 years ago, In English

For this problem, the tutorial states that maintaining the sum of a Geometric Progression is a simple problem that can be solved using Segment Tree. However, I don't know how to do this (I think Lazy Propogation should be involved). Any help please?

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

»
9 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

The editorial is not written very well and the proposed solution is kind of crazy. Xellos' comment does a much better job of explaining it.

Edit: Here's my code. Not very fast, but it fits. No matrix multiplication used either.