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

Method query

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

Source from the content-addressed store, hash-verified

6 rep(i,0,size(arr)-(1<<k)+1)
7 m[k][i] = min(m[k-1][i], m[k-1][i+(1<<(k-1))]); } }
8 int query(int l, int r) {
9 int k = 0; while (1<<(k+1) <= r-l+1) k++;
10 return min(m[k][l], m[k][r-(1<<k)+1]); } };
11// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected