copypasta

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const P = 998244353

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitset

type Bitset []uint

func NewBitset

func NewBitset(n int) Bitset

func (Bitset) Equals

func (b Bitset) Equals(c Bitset) bool

下面几个方法均需保证长度相同

func (Bitset) Flip

func (b Bitset) Flip(p int)

func (Bitset) Foreach

func (b Bitset) Foreach(f func(p int) (Break bool))

遍历所有 1 的位置 如果对范围有要求,可在 f 中 return p < n

func (Bitset) Has

func (b Bitset) Has(p int) bool

func (Bitset) HasSubset

func (b Bitset) HasSubset(c Bitset) bool

func (Bitset) Index0

func (b Bitset) Index0() int

返回第一个 0 的下标,不存在时会返回一个不小于 n 的位置

func (Bitset) Index1

func (b Bitset) Index1() int

返回第一个 1 的下标,不存在时会返回一个不小于 n 的位置(同 C++ 中的 _Find_first)

func (Bitset) Merge

func (b Bitset) Merge(c Bitset)

将 c 的元素合并进 b

func (Bitset) Next1

func (b Bitset) Next1(p int) int

返回下标严格大于 p 的第一个 1 的下标,不存在时会返回一个不小于 n 的位置(同 C++ 中的 _Find_next)

func (Bitset) OnesCount

func (b Bitset) OnesCount() (c int)

返回 1 的个数

func (Bitset) Reset

func (b Bitset) Reset(p int)

func (Bitset) Rsh

func (b Bitset) Rsh(k int)

右移 k 位

func (Bitset) Set

func (b Bitset) Set(p int)

type Deque

type Deque struct {
	// contains filtered or unexported fields
}

l-1,...1,0,0,1...,r-1

func (Deque) Back

func (q Deque) Back() interface{}

func (Deque) Empty

func (q Deque) Empty() bool

func (Deque) Front

func (q Deque) Front() interface{}

func (Deque) Get

func (q Deque) Get(i int) interface{}

0 <= i < q.Size()

func (*Deque) PopBack

func (q *Deque) PopBack() (v interface{})

func (*Deque) PopFront

func (q *Deque) PopFront() (v interface{})

func (*Deque) PushBack

func (q *Deque) PushBack(v interface{})

func (*Deque) PushFront

func (q *Deque) PushFront(v interface{})

func (Deque) Size

func (q Deque) Size() int

type Int

type Int struct{ *big.Int }

以 s 结尾的方法,s 代表 self

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL