a nice problem on data structures

Правка en2, от Badry, 2016-09-12 02:56:57

Hi codeforces, I need to solve this sub task " given an array of zeros we need to apply 2 types of operations on it 1- increment elements in a given range by 1 or decrement them by -1 .. 2- count the number of positive integers in the array " I have a solution which work in O(M*sqrtN*logN) where M is the number of operations. but this solution is not fast enough to pass the time limit .. could some one please give me a faster solution. thanks in advance

Теги #data structure

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Badry 2016-09-12 02:56:57 9 Tiny change: 'o apply 2 kind of operat' -> 'o apply 2 types of operat'
en1 Английский Badry 2016-09-12 02:55:57 495 Initial revision (published)