|
|
back to boardHint Posted by basuki 25 Mar 2019 08:32 Segment Tree/ Fenwick Tree with range update and point query Re: Hint Posted by Apkawa 24 Apr 2022 11:50 Too expensive for this problem. You can just add c to some array[a] and add -c to array[b + 1]. So when you need to print the answer, you just do loop through all knights from 1 to n and firstly add value from array[i] to some variable, then print this variable. |
|
|