We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f5eb56 commit 4e14e89Copy full SHA for 4e14e89
library/data_structures_[l,r]/seg_tree.hpp
@@ -2,11 +2,19 @@
2
//! https://codeforces.com/blog/entry/118682
3
//! @code
4
//! {
5
-//! tree st(n, 0LL, [&](ll l, ll r) {
6
-//! return l + r;
+//! tree st(a, [&](int vl, int vr) {
+//! return vl & vr;
7
//! });
8
//! }
9
-//! tree st(n, INT_MAX, ranges::min);
+//! {
10
+//! tree st(n, 0LL, plus<ll>{});
11
+//! }
12
13
+//! tree st(n, INT_MAX, ranges::min);
14
+//! int idx = st.walk(l, r, [&](int value) {
15
+//! return value <= x;
16
+//! }); // smallest index in [l, r] s.t. f is true
17
18
//! @endcode
19
//! @time O(n + q log n)
20
//! @space O(n)
0 commit comments