whatthemomooofun1729's blog

By whatthemomooofun1729, history, 11 months ago, In English

Hi, I'm working on problem 296C and I am trying to solve it using a BIT. However, I keep getting WA on test 11. I've tried my own test cases but could not find the problem in my code. Here is my submission: 211297450. Could someone help me find it? Thank you!

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

In order to add the value d on the segment [x, y], it is enough to create an array b and put the values b[x] += d b[y+1] -= d Further, in one pass through the array, all numbers are easily restored. Let's apply this method twice: first for requests, and then for operations (knowing how many times we will execute it).

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

Auto comment: topic has been updated by whatthemomooofun1729 (previous revision, new revision, compare).