shubham1694's blog

By shubham1694, 9 years ago, In English

I am trying to solve this problem on spoj. The problem gives an input of n integers and then asks q queries which are of the form l r k and the program has to output number of elements greater than k in the subsequence al, al+1, ..., ar. I am using persistent segment trees to process queries online.but i am getting wrong answer. I am not able to find why my code fails.

Here's my code

Note: I know there's a way to solve this problem offline.But I am interested in online solution.

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it