spoj HAYBALE – Haybale stacking

you can find the problem description here.

this is my first Segment Tree with lazy propagation problem. basically for a range update we just don’t propagate the update until it is necessary

you can learn more about the Segment Tree with lazy propagation from here[link1, link2]

https://gist.github.com/98ca9dc4c75224db48f0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s