Doubt in max query (Segment Tree)

why ther is run error in submitting process.
code link is : https://ide.codingblocks.com/s/289243

@Tauheed90 don’t push_back into tree!
initialize tree as
vector tree(4*n+1);
(use round brackets)
and for initialization use it as array!
tree[node] = …

i have defined array of vector and for each node there is vector so pushing operation is done. It will be helpful if you make some changes in code only.

Actually question is to find the no of element present in given range(index l to r) greater than given value(some value k).

question is: You are given an array A of N elements and Q queries. Each query consists of 3 integers L R K. For each query, you have to find the number of elements Ax1, Ax2,….,Axj>=K, where L<=x1, x2,…xj<=R.

@Tauheed90 your code is perfectly fine (sorry for my misjudgement), runerror was due to memory limitations of platform,
this works fine now: https://ide.codingblocks.com/s/290097