rust-lang-ja / ac-library-rs

ac-library-rs is a rust port of AtCoder Library (ACL).
Creative Commons Zero v1.0 Universal
225 stars 27 forks source link

Allow `RangeBounds` for fenwicktree, segtree, and lazysegtree #101

Closed TonalidadeHidrica closed 1 year ago

TonalidadeHidrica commented 2 years ago

The rustic way to specify a certain range of a container is to use s..t notation. I changed the signature of FenwickTree::sum, Segtree::prod, and LazySegtree::prod so that they accept any range notation like .., s..t, s..=t, ..t and so on.

TonalidadeHidrica commented 2 years ago

Oh by the way, I forgot to change the signature of LazySegtree::apply_range too. I'll do it later.