Was trying to solve http://www.spoj.com/problems/HORRIBLE/ with lazy propgation http://ideone.com/oSdgKp but could not get the logic of using the ""tree[node]+=val*(min(b,j)-max(a,i));"" as the code was copied..:P..or could any one plzz suggest how to solve this (i have an idea of out to solve with lazy propagation with still was unable to code..:()..
↧