AtCoder::SegTree(T)
Inherits Reference / Object
Implements atcoder::segtree.
The identity element will be implicitly defined as nil, so you don't have to manually define it. In the other words, you cannot include nil into an element of the monoid.
tree = AtCoder::SegTree.new((0...100).to_a) { |a, b| [a, b].min }
tree[10...50] # => 10
Constructors
new(values : Array(T))
Sourcenew(values : Array(T), &operator : T, T -> T)
SourceInstance methods
max_right(left, e : T | Nil = nil, & : T -> Bool)
Implements atcoder::lazy_segtree.max_right(left, g).
min_left(right, e : T | Nil = nil, & : T -> Bool)
Implements atcoder::lazy_segtree.min_left(right, g).
values
Source