Segment Tree , March Cookoff Div 1 , Please help , 🙏

editorial of problem:

My Code Link:

Correct Code Link:

Thanks in Advance