I have implemented segment tree correctly but I don't know why I am getting TLE in GSS1 problem. I have also used fast I/O methods.Can anyone please help me. Link to my code is: http://pastebin.com/hSuXPuqvProblem link: http://www.spoj.com/problems/GSS1/
Please post your code in-line. Make sure to use the preformatting.