Help me to make a data structure

Revision en1, by frostcloud, 2024-09-11 22:03:55

Create a data structure, that can:

  1. Add/subtract a number on a segment;
  2. Count amount of negative numbers on a segment.

How to solve it for $$$O(\sqrt{n})$$$ / $$$O(\log^2{n})$$$ / $$$O(\log{n})$$$ per query?

Tags data structures, range query

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English frostcloud 2024-09-11 22:03:55 239 Initial revision (published)