LeCalin's blog

By LeCalin, history, 7 years ago, In English

Hello Codeforces.

Today I read about Fenwick tree. Correctly update in range and find sum in range. Update in range, it means adding value to the range. Can we set value in range and find sum in range with fenwick tree?

Sorry for my English.

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

| Write comment?
»
7 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it
  • »
    »
    7 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I said set value in range, main word " in range "

    • »
      »
      »
      7 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Sorry, but in Fenwick Tree you can't update in range. But you can use Segment Tree. In Segment Tree you can do nearly anything.