Add segtree by c++