Frequency of a number in the given range.....[L,R]
Difference between en1 and en2, changed 2 character(s)
I tried to solve this question but suddenly a question strike to my mind what if we have to find the value of ONLY F(L,R,X)↵
one solution which strike to me is like..just take map< long long,vector<int> >mp,and for each element 
foof the given array just insert its corresponding index at that location for example if arr[]=[2,3,4,5,2,2].So mp[2]={0,5,6},mp[3]={3},mp[4]={2} and so on...↵
and just take lower bound and upper bound of the value of L and R in mp[x]. So it will give us answer in ↵
NO of Query * O(log(abs(R-L)).↵

But Can some one please suggest me **how can i can calculate ONLY F(L,R,X) by using SEGMENT TREE** ↵
[Proble Link](http://codeforces.com/problemset/problem/459/D).....↵

Thanks In Advance..!!↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English shailesh_24 2017-06-08 20:33:43 2 Tiny change: 'og(abs(R-L)).\n\nBut' -> 'og(abs(R-L+1)).\n\nBut'
en3 English shailesh_24 2017-06-08 05:35:27 96
en2 English shailesh_24 2017-06-08 05:31:25 2 Tiny change: 'h element fo the given' -> 'h element of the given'
en1 English shailesh_24 2017-06-08 05:29:39 771 Initial revision (published)