a nice problem on data structures

Revision en2, by 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

Tags #data structure

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Badry 2016-09-12 02:56:57 9 Tiny change: 'o apply 2 kind of operat' -> 'o apply 2 types of operat'
en1 English Badry 2016-09-12 02:55:57 495 Initial revision (published)