segment tree with lazy update problem?

Hi, I am getting tle on this problem in UVA, http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2397 … 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