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

Function range_query

code/data-structures/fenwick_tree.cpp:23–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21void range_update(fenwick_tree_sq &s, int a, int b, int k) {
22 s.update(a, k, k * (1 - a)); s.update(b+1, -k, k * b); }
23int range_query(fenwick_tree_sq &s, int a, int b) {
24 return s.query(b) - s.query(a-1); }
25// vim: cc=60 ts=2 sts=2 sw=2:

Callers 1

test2Function · 0.85

Calls 1

queryMethod · 0.45

Tested by 1

test2Function · 0.68