Изменения
→Реализация
<code>
int get_sum (int <tex>node</tex>, int <tex>a</tex>, int <tex>b</tex>)
{
return 0;
if <tex>[l, r)</tex> == <tex>[a, b)</tex> return tree[<tex>node</tex>]; int <tex>m</tex> = (<tex>l</tex> + <tex>r</tex>) / 2; return get_sum (<tex>node</tex> * 2 + 1, <tex>a</tex>, min(<tex>b</tex>, <tex>m</tex>)) + get_sum (<tex>node</tex> * 2 + 2, max(<tex>a</tex>, <tex>m</tex>), <tex>b</tex>);
}
</code>