Data Structures, Algorithms, Leetcode, Segment Tree, Programming.
our target search range inline bitset<101> query(int rt, int L, int R, int ql, int qr) { if (ql > R or qr < L) return bitset<101>(); // Case 1 (disjoint) if (ql <= L and R <= qr) return sum[rt]; // Case 2 (fully contained) int mid = (L + R) >> 1; // Case 3 (intersection) return query(2 * rt, L,