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

Method query

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

Source from the content-addressed store, hash-verified

19 return arr[i] =
20 node(update(at,v,2*i+1),update(at,v,2*i+2)); }
21 node query(int l, int r, int i=0) {
22 propagate(i);
23 int hl = arr[i].l, hr = arr[i].r;
24 if (r < hl || hr < l) return node(hl,hr);
25 if (l <= hl && hr <= r) return arr[i];
26 return node(query(l,r,2*i+1),query(l,r,2*i+2)); }
27 node range_update(int l, int r, ll v, int i=0) {
28 propagate(i);
29 int hl = arr[i].l, hr = arr[i].r;

Callers

nothing calls this directly

Calls 2

queryFunction · 0.85
nodeClass · 0.70

Tested by

no test coverage detected