tree[node] = tree[2*node +1] + tree[2*node +2]; }// 更新线段树publicvoidupdate(intnode,intleft,intright,intidx,intval){if(left > right)return;elseif(left == right){ nums[left] = val; tree[node] = val; }else{intmid=left + ((left + right)>>1);if(idx >= left && idx ...