1

I have to use segment tree(may be other data structure if possible) to calculate the minimum over an interval, more specifically, over [1,i] where 1 is the first element of the array.Now, I have some queries to update an interval (i.e. from [1,i-1]) with different values, more specifically, I have to add (2i-3) to the first element, (2i-5) to the second element and so on up to the (i-1)th element where I have to add (2i-(2(i-1)+1) i.e. 1. After doing this update, I have to calculate the minimum from [1,i]. This has to be done for 1<=i<=N and N is of order 10^5.So you will doing some O(NlogN) thing to make it run.

0 Answers0