IOI 2005 Mountains

Did someone solve this problem because i can’t really understand how does the segment tree store information about the sequence.