| 1 | #ifndef STNODE |
| 2 | #define STNODE |
| 3 | struct node { |
| 4 | int l, r; |
| 5 | ll x, lazy; |
| 6 | node() {} |
| 7 | node(int _l, int _r) : l(_l), r(_r), x(0), lazy(0) { } |
| 8 | node(int _l, int _r, ll _x) : node(_l,_r) { x = _x; } |
| 9 | node(node a, node b) : node(a.l,b.r) { x = a.x + b.x; } |
| 10 | void update(ll v) { x = v; } |
| 11 | void range_update(ll v) { lazy = v; } |
| 12 | void apply() { x += lazy * (r - l + 1); lazy = 0; } |
| 13 | void push(node &u) { u.lazy += lazy; } }; |
| 14 | #endif |
| 15 | // vim: cc=60 ts=2 sts=2 sw=2: |
nothing calls this directly
no outgoing calls
no test coverage detected