Asking for help with the following data structure problem

Revision en1, by a_few_what_ifs, 2021-04-17 00:25:37

Hi everybody! I am new to CF community and recently came across with this problem, what can be the solution for it? Any help is appreciated!

There is an array of length $$$N$$$ consisting of numbers and array is one-indexed from $$$1$$$ to $$$N$$$. There are three types of operations :

1) Add $$$1$$$ to the number at index $$$A$$$,

2) Print the number of numbers that is bigger than or equal to $$$X$$$,

3) For all of the numbers bigger than or equal to $$$Y$$$, subtract $$$1$$$ from them.

Initially, any number in the array is at most $$$10^8$$$. Array length $$$N$$$ and number of operations $$$Q$$$ is at most $$$10^5$$$.

Sidenote : Although I knew CF (I read the blogs, they're quite helpful) I didn't have any account till now and decided to open one to ask the question above. That is kinda out of scope but I don't know if newcomers' questions are welcomed and I apologize if I've done something wrong with the format or website rules.

Tags #data structure, #help, #range query, #data structures

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English a_few_what_ifs 2021-04-17 00:25:37 981 Initial revision (published)