Used arrays instead of vectors.

In the constructor of Segment Tree, T[] of leaves had been used instead
of a vector<T>.