AtCoder::FenwickTree(T)
Inherits Reference / Object
Implements atcoder::fenwick_tree.
tree = AtCoder::FenwickTree(Int64).new(10)
tree.add(3, 10)
tree.add(5, 20)
tree[3..5] # => 30
tree[3...5] # => 10
Constructors
new(size : Int64)
Sourcenew(bits : Array)
SourceInstance methods
[](range : Range)
Implements atcoder::fenwick_tree.sum(left, right)
Open ended ranges are clamped at the start and end of array, respectively.
bits
Sourcesize
Sourcesum(range : Range)
Implements atcoder::fenwick_tree.sum(left, right)
Open ended ranges are clamped at the start and end of array, respectively.