segment tree with lazy update problem?

Hi, I am getting tle on this problem in UVA, Online Judge … Here is my solution. I used segment tree with lazy update. But why Still I am getting tle? here is my solution http://ideone.com/WDK1eu