MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / query

Function query

Data Structures/Reachability Tree.cpp:95–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 t[n] = combine(t[2 * n], t[2 * n + 1]);
94}
95inline pair<int, int> query(int n, int l, int r, int ql, int qr) {
96 push(n, l, r);
97 if (l > qr || r < ql) return make_pair(1e9, 0);
98 if (l >= ql && r <= qr) return t[n];
99 int mid = l + r >> 1;
100 pair<int, int> left = query(2 * n, l, mid, ql, qr);
101 pair<int, int> rght = query(2 * n + 1, mid + 1, r, ql, qr);
102 return combine(left, rght);
103}
104queue<pair<int, int>> Q;
105int32_t main() {
106 ios_base::sync_with_stdio(0);

Callers 1

mainFunction · 0.70

Calls 2

pushFunction · 0.70
combineFunction · 0.70

Tested by

no test coverage detected