我对问题HORRIBLE
的结果不正确这是我的代码: http://ideone.com/1Yb3yp
node query(int root,int l_most,int r_most,int l,int r)
{
if(l_most >= l && r_most <= r)
return tree[root];
int l_child = (root<<1) , r_child = l_child + 1,mid = (l_most + r_most )>>1;
node left=node(),right = node();
if(l<=mid)
left = query(l_child,l_most,mid,l,r);
if(r>mid)
right = query(r_child,mid+1,r_most,l,r);;
node temp = node();
temp.merge(left,right);
return temp;
}