ac-library-hs-0.1.0.0: Data structures and algorithms
Safe HaskellNone
LanguageGHC2021

AtCoder.Extra.Monoid.RangeAddId

Description

Monoid action for setting interval \([l, r)\) over ideomponent monoids.

Since: 1.0.0

Synopsis

RangeAddId

newtype RangeAddId a #

Range set monoid action.

Example

>>> import AtCoder.Extra.Monoid (SegAct(..), RangeAddId(..))
>>> import AtCoder.LazySegTree qualified as LST
>>> import Data.Semigroup (Max(..))
>>> seg <- LST.build @_ @(RangeAddId Int) @(Max Int) $ VU.generate 3 Max -- [0, 1, 2]
>>> LST.applyIn seg 0 3 $ RangeAddId 5 -- [5, 6, 7]
>>> getMax <$> LST.prod seg 0 3
7

Since: 1.0.0

Constructors

RangeAddId a 

Instances

Instances details
Unbox a => Vector Vector (RangeAddId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Unbox a => MVector MVector (RangeAddId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Num a => Monoid (RangeAddId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Num a => Semigroup (RangeAddId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Show a => Show (RangeAddId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Eq a => Eq (RangeAddId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Methods

(==) :: RangeAddId a -> RangeAddId a -> Bool #

(/=) :: RangeAddId a -> RangeAddId a -> Bool #

Ord a => Ord (RangeAddId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Unbox a => Unbox (RangeAddId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Num a => SegAct (RangeAddId a) (Max a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Methods

segAct :: RangeAddId a -> Max a -> Max a #

segActWithLength :: Int -> RangeAddId a -> Max a -> Max a #

Num a => SegAct (RangeAddId a) (Min a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Methods

segAct :: RangeAddId a -> Min a -> Min a #

segActWithLength :: Int -> RangeAddId a -> Min a -> Min a #

newtype MVector s (RangeAddId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

newtype MVector s (RangeAddId a) = MV_RangeAddId (MVector s a)
newtype Vector (RangeAddId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeAddId

Constructor

new :: a -> RangeAddId a #

Creates RangeAddId.

Since: 1.0.0

Action

act :: Num a => RangeAddId a -> a -> a #

Applies one-length range add: \(f: x \rightarrow d + x\).

Since: 1.0.0