Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Adapting BIT to offline type problems
Разница между en1 и en2, 79 символ(ов) изменены
**Consider the following problem
==================
:**

Given an initial array of 
"n"$n$ integers and "q"$q$ queries of the form:↵

I x V$I$  $x$ $V$ : Add V$V$ to the i$i$-th position on the vector. If it is not empty (equals 0) then add it between the position xs $x$ and $x + 1$.↵

S x y$S$ $x$ $y$ : Calculate the sum of all elements from index $x$ to y$y$, inclusively.↵

My teacher has advised 
to tryus to use *RMQ* or an o*Offline Segment Tree* for this one, but i would like to know if there´s a way of adapting the Fenwick Tree to support this sort of "*shift"* that may need to be done on the vector efficiently.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский kowalsk1 2018-05-25 04:18:39 9 Tiny change: 'on on the vector. If it is' -> 'on on the array. If it is'
en4 Английский kowalsk1 2018-05-25 04:18:12 23 Tiny change: '$ integers and $q$ queri' -> '$ integers, you´re asked to perform $q$ queri'
en3 Английский kowalsk1 2018-05-25 04:16:47 2 Tiny change: '$ to the $i$-th posit' -> '$ to the $x$-th posit'
en2 Английский kowalsk1 2018-05-25 04:16:00 79 Tiny change: '------\n\nGiven an i' -> '------\n\n###Given an i' (published)
en1 Английский kowalsk1 2018-05-25 04:09:15 602 Initial revision (saved to drafts)