MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / mk

Method mk

code/data-structures/segment_tree.cpp:8–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 segment_tree(const vector<ll> &a) : n(size(a)), arr(4*n) {
7 mk(a,0,0,n-1); }
8 node mk(const vector<ll> &a, int i, int l, int r) {
9 int m = (l+r)/2;
10 return arr[i] = l > r ? node(l,r) :
11 l == r ? node(l,r,a[l]) :
12 node(mk(a,2*i+1,l,m),mk(a,2*i+2,m+1,r)); }
13 node update(int at, ll v, int i=0) {
14 propagate(i);
15 int hl = arr[i].l, hr = arr[i].r;

Callers

nothing calls this directly

Calls 1

nodeClass · 0.70

Tested by

no test coverage detected