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

Автор whatthemomooofun1729, история, 11 месяцев назад, По-английски

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!

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

»
11 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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