How can i solve a query l-r-x on array where values x,2x,3x,...(r-l+1)x are added to Array[l,l+1,l+2...r] respectively. All ideas are welcomed...
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
2 | maomao90 | 163 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
Name |
---|
What do you mean by updations? Isn't that a updation you mentioned?
See here: http://codeforces.net/blog/entry/54103?#comment-381730
Where should i look for explanation in your provided link. Please can you be more precise...
It should help: http://codeforces.net/blog/entry/53052
Are there any queries like asking what is the value at some index, or the sum of the elements in a range? Or is it just updating with this kind of updates (and in the end maybe, outputting the whole array)?
If it's the first kind (updates and queries) you could refer to the links other people provided you above using a segment tree as it should be optimal, however if all you need to do is updates then a solution with a total running time of can be done (N, U are the array size and the number of updates, respectively).