I am trying to solve the problem https://mirror.codeforces.com/problemset/problem/295/A but i haven't any idea about this problem .So i am seeking some hints about this problem .Please help me to solve this problem out
# | User | Rating |
---|---|---|
1 | jiangly | 3976 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3482 |
8 | hos.lyric | 3382 |
9 | gamegame | 3374 |
10 | heuristica | 3357 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | -is-this-fft- | 162 |
3 | Um_nik | 161 |
4 | atcoder_official | 160 |
5 | djm03178 | 157 |
5 | Dominater069 | 157 |
7 | adamant | 154 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 148 |
I am trying to solve the problem https://mirror.codeforces.com/problemset/problem/295/A but i haven't any idea about this problem .So i am seeking some hints about this problem .Please help me to solve this problem out
Name |
---|
Use the concept of difference arrays to compute the number of times each operation will be applied on the array.
Now that you know how many times each operation is applied on the array, you also know that the increase d for a particular operation will be multiplied by the number of times the operation is going to be applied on the array. Since you have the information about the final increase d and the range for a particular operation, you can use another difference array to actually find the final increase for each index in the array. Now the answer can be obtained by adding the initial values in the input to the values computed in the difference array. Solution: 92685983
thank you so much
You should give
+1
contribution to the one who helped you. I gave him+1