Hello, I recently remembered a problem statement that was something like this :

We have an array A of n integers and we need to answer the following type of queries. Q(l, r, p) means how many numbers from A[l..r] are less than p. The author mentioned that it can be done using a segment tree, but did not provide any further clarifications and I cannot wrap my head around it.

Any ideas/tips ?

Thanks in advance !

  • created

    Oct '14
  • last reply

    Oct '14
  • 1

    reply

  • 638

    views

  • 2

    users

  • 1

    link

Suggested Topics

Topic Category Replies Views Activity
Off-topic 1 79 Apr 9

Want to read more? Browse other topics in Off-topic or view latest topics.