Editorial for Mock CCC '18 Contest 3 S5 - A Rage Tree Problem
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
The intended solution was to build a rage tree with lazy propagation on the number of cones over a price range. A given node has a price range and has information on the number of cones in its interval and the cost of those cones. Support for lazily propagating range increments and deletions must be built into the rage tree.
Comments