Hey My Quesiotn Is About Segment Tree.
I Already Read The source code for it From Comptetive Prog 3 But What I need to know is how to Do The Lazy Updating Or The Lazy Teqh.
Can Any One Give And Example So I Can UnderStand This Teqh Im Facing A Proplem With UnderStanding This Teqh.
And Another Thing Im Wondring If I Can Solve This Proplem Using Segment Tree
The Link : (http://codeforces.me/contest/283/problem/A);
My Submission : (http://codeforces.me/contest/283/submission/12340325)
Sorry For My Boor English . Have A Nice Day.
No Proplem I Will Try To UnderStand it From The Code Thanks Very Much
Ok I hope it will help you
First my English is poor too...
Lazy Propagation: you don't need to update all of the elements in the segment,just update the parent when it's total overlap and mark it's children for later...
First: If you don't understand segment tree 100% watch this
segment tree:build,answer a query and normal update java code just under stand algorithm don't worry for it's programming language.
Lazy Propagation Article here
Easy and some hard problems Here
Thanks BatMan As Usual You Save People :P