Блог пользователя zscoder

Автор zscoder, история, 9 лет назад, По-английски

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?

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

»
9 лет назад, # |
Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

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.