tree[node] = tree[node*2+1] + tree[node*2+2]; } }// 查询线段树publicintquery(intnode,intleft,intright,intL,intR){if(right < L || left > R)return0;elseif(left == right)returntree[node];elseif(L<= left && R >= right)returntree[node];else{intmid=left + ((right - left)...