Skip to content

Instantly share code, notes, and snippets.

@slycelote
slycelote / segment-tree.cpp
Created July 28, 2019 02:48
Segment tree with lazy propagation
// See https://codeforces.com/blog/entry/44478#comment-290116
// This (mostly untested) implementation is for educational purposes only
// and suffers from several drawbacks. Most notably, segment ends have to
// be stored in every operation (and every node), even though they can be
// calculated 'on the fly'.
#include <vector>
using namespace std;