Safe Haskell | None |
---|---|
Language | GHC2021 |
Monoid action for setting interval \([l, r)\).
Since: 1.0.0
RangeAdd
Range set monoid action.
Example
>>>
import AtCoder.Extra.Monoid (SegAct(..), RangeAdd(..))
>>>
import AtCoder.LazySegTree qualified as LST
>>>
import Data.Semigroup (Max(..))
>>>
seg <- LST.build @_ @(RangeAdd Int) @(Sum Int) $ VU.generate 3 Sum -- [0, 1, 2]
>>>
LST.applyIn seg 0 3 $ RangeAdd 5 -- [5, 6, 7]
>>>
getSum <$> LST.prod seg 0 3
18
Since: 1.0.0
RangeAdd a |