Safe Haskell | None |
---|---|
Language | GHC2021 |
SegAct
instance of range set action. It can set an interval \([l, r)\) to
the same monoid \(x\) such as Sum Int
.
Since: 1.0.0
RangeSet
SegAct
instance of range set action.
Example
>>>
import AtCoder.Extra.Monoid (SegAct(..), RangeSet(..))
>>>
import AtCoder.LazySegTree qualified as LST
>>>
import Data.Semigroup (Product(..))
>>>
seg <- LST.build @_ @(RangeSet (Product Int)) @(Product Int) $ VU.generate 4 Product -- [0, 1, 2, 3]
>>>
LST.applyIn seg 0 3 $ RangeSet (True, Product 5) -- [5, 5, 5, 3]
>>>
getProduct <$> LST.prod seg 0 4
375
Since: 1.0.0
RangeSet (RangeSetRepr a) |