restart.'s blog

By restart., 10 years ago, In English

Can we solve spoj MULTQ3 using BIT? If yes then How?

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I think you can't do this problem with a BIT, because you have to do intervals update. But you can try with a segment tree with lazy propagation.

»
10 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Oh, I haven't thought using BIT. This problem I use Segment Tree.

If you haven't solve this problem with Segment Tree, you can go this link1 and link2 to know about Segment Tree

And this is my solution.

If you want to continue with thinking of using BIT, I will prevent you. Hope you can do this.