competitive/data_structure/
mod.rs1use crate::algebra::{
4 AbelianGroup, AbelianMonoid, AdditiveOperation, Associative, EmptyAct, Group, LazyMapMonoid,
5 Magma, MaxOperation, MinOperation, Monoid, MonoidAct, SemiGroup, Unital,
6};
7use crate::algorithm::{BitDpExt, SliceBisectExt};
8use crate::num::{Bounded, RangeBoundsExt};
9use crate::tools::{Comparator, Xorshift, comparator};
10
11#[codesnip::entry("Accumulate")]
12pub use self::accumulate::{Accumulate, Accumulate2d, AccumulateKd};
13#[codesnip::entry("Allocator")]
14pub use self::allocator::{Allocator, BoxAllocator, MemoryPool};
15#[codesnip::entry("BinaryIndexedTree")]
16pub use self::binary_indexed_tree::BinaryIndexedTree;
17#[codesnip::entry("BinaryIndexedTree2D")]
18pub use self::binary_indexed_tree_2d::BinaryIndexedTree2D;
19#[codesnip::entry("BitVector")]
20pub use self::bit_vector::{BitVector, RankSelectDictionaries};
21#[codesnip::entry("BitSet")]
22pub use self::bitset::BitSet;
23#[codesnip::entry("compress")]
24pub use self::compress::{Compressor, HashCompress, VecCompress};
25#[codesnip::entry("CompressedBinaryIndexedTree")]
26pub use self::compressed_binary_indexed_tree::{
27 CompressedBinaryIndexedTree, CompressedBinaryIndexedTree1d, CompressedBinaryIndexedTree2d,
28 CompressedBinaryIndexedTree3d, CompressedBinaryIndexedTree4d,
29};
30#[codesnip::entry("CompressedSegmentTree")]
31pub use self::compressed_segment_tree::{
32 CompressedSegmentTree, CompressedSegmentTree1d, CompressedSegmentTree2d,
33 CompressedSegmentTree3d, CompressedSegmentTree4d,
34};
35#[codesnip::entry("container")]
36pub use self::container::{
37 BTreeMapFactory, Container, ContainerEntry, ContainerFactory, HashMapFactory,
38 HashMapFactoryWithCapacity,
39};
40#[codesnip::entry("Counter")]
41pub use self::counter::{BTreeCounter, HashCounter};
42#[codesnip::entry("DisjointSparseTable")]
43pub use self::disjoint_sparse_table::DisjointSparseTable;
44#[codesnip::entry("FibonacciHash")]
45pub use self::fibonacci_hash::{
46 FibHashMap, FibHashSet, FibonacciHasher, FibonacciHasheru32, FibonacciHasheru64,
47};
48#[codesnip::entry("Static2DTree")]
49pub use self::kdtree::Static2DTree;
50#[codesnip::entry("LazySegmentTree")]
51pub use self::lazy_segment_tree::LazySegmentTree;
52#[codesnip::entry("LazySegmentTreeMap")]
53pub use self::lazy_segment_tree_map::LazySegmentTreeMap;
54#[codesnip::entry("LineSet")]
55pub use self::line_set::LineSet;
56#[codesnip::entry("PairingHeap")]
57pub use self::pairing_heap::PairingHeap;
58#[codesnip::entry("PartiallyRetroactivePriorityQueue")]
59pub use self::partially_retroactive_priority_queue::PartiallyRetroactivePriorityQueue;
60#[codesnip::entry("RangeArithmeticProgressionAdd")]
61pub use self::range_ap_add::RangeArithmeticProgressionAdd;
62#[codesnip::entry("RangeFrequency")]
63pub use self::range_frequency::RangeFrequency;
64#[codesnip::entry("RangeMap")]
65pub use self::range_map::{RangeMap, RangeSet};
66#[codesnip::entry("RangeMinimumQuery")]
67pub use self::range_minimum_query::RangeMinimumQuery;
68#[codesnip::entry("SegmentTree")]
69pub use self::segment_tree::SegmentTree;
70#[codesnip::entry("SegmentTreeMap")]
71pub use self::segment_tree_map::SegmentTreeMap;
72#[codesnip::entry("sliding_window_aggregation")]
73pub use self::sliding_window_aggregation::{DequeAggregation, QueueAggregation};
74#[codesnip::entry("slope_trick")]
75pub use self::slope_trick::SlopeTrick;
76#[codesnip::entry("SparseSet")]
77pub use self::sparse_set::SparseSet;
78#[codesnip::entry("SplayTree")]
79pub use self::splay_tree::{SplayMap, SplaySequence};
80#[codesnip::entry("SubmaskRangeQuery")]
81pub use self::submask_range_query::SubmaskRangeQuery;
82#[codesnip::entry("transducer")]
83pub use self::transducer::*;
84#[codesnip::entry("Treap")]
85pub use self::treap::{Treap, TreapData};
86#[codesnip::entry("Trie")]
87pub use self::trie::Trie;
88#[codesnip::entry("UnionFind")]
89pub use self::union_find::{
90 MergingUnionFind, PotentializedUnionFind, UndoableUnionFind, UnionFind, UnionFindBase,
91};
92#[codesnip::entry("VecMap")]
93pub use self::vec_map::{FixedVecMapFactory, VecMap, VecMapFactory, VecMapFactoryWithCapacity};
94#[codesnip::entry("WaveletMatrix")]
95pub use self::wavelet_matrix::WaveletMatrix;
96
97#[cfg_attr(
98 nightly,
99 codesnip::entry("Accumulate", include("algebra", "discrete_steps"))
100)]
101mod accumulate;
102#[cfg_attr(nightly, codesnip::entry("Allocator"))]
103mod allocator;
104#[cfg_attr(nightly, codesnip::entry("BinaryIndexedTree", include("algebra")))]
105mod binary_indexed_tree;
106#[cfg_attr(nightly, codesnip::entry("BinaryIndexedTree2D", include("algebra")))]
107mod binary_indexed_tree_2d;
108#[cfg_attr(
109 nightly,
110 codesnip::entry("binary_search_tree", include("Allocator", "LazyMapMonoid"))
111)]
112pub mod binary_search_tree;
113#[cfg_attr(nightly, codesnip::entry("BitVector"))]
114mod bit_vector;
115#[cfg_attr(nightly, codesnip::entry("BitSet"))]
116mod bitset;
117#[cfg_attr(nightly, codesnip::entry("compress", include("binary_search")))]
118mod compress;
119#[cfg_attr(
120 nightly,
121 codesnip::entry("CompressedBinaryIndexedTree", include("algebra", "binary_search"))
122)]
123mod compressed_binary_indexed_tree;
124#[cfg_attr(
125 nightly,
126 codesnip::entry("CompressedSegmentTree", include("algebra", "binary_search"))
127)]
128mod compressed_segment_tree;
129#[cfg_attr(nightly, codesnip::entry("container"))]
130mod container;
131#[cfg_attr(nightly, codesnip::entry("Counter"))]
132mod counter;
133#[cfg_attr(nightly, codesnip::entry("DisjointSparseTable", include("algebra")))]
134mod disjoint_sparse_table;
135#[cfg_attr(nightly, codesnip::entry("FibonacciHash"))]
136mod fibonacci_hash;
137#[cfg_attr(nightly, codesnip::entry("Static2DTree"))]
138mod kdtree;
139#[cfg_attr(
140 nightly,
141 codesnip::entry("LazySegmentTree", include("LazyMapMonoid", "discrete_steps"))
142)]
143mod lazy_segment_tree;
144#[cfg_attr(
145 nightly,
146 codesnip::entry("LazySegmentTreeMap", include("LazyMapMonoid", "discrete_steps"))
147)]
148mod lazy_segment_tree_map;
149#[cfg_attr(nightly, codesnip::entry("LineSet", include("bounded")))]
150mod line_set;
151#[cfg_attr(
152 nightly,
153 codesnip::entry("PairingHeap", include("Comparator", "MonoidAct"))
154)]
155mod pairing_heap;
156#[cfg_attr(
157 nightly,
158 codesnip::entry(
159 "PartiallyRetroactivePriorityQueue",
160 include("bounded", "SegmentTree", "MaxOperation", "MinOperation")
161 )
162)]
163pub mod partially_retroactive_priority_queue;
164#[cfg_attr(nightly, codesnip::entry("RangeArithmeticProgressionAdd"))]
165mod range_ap_add;
166#[cfg_attr(
167 nightly,
168 codesnip::entry("RangeFrequency", include("BinaryIndexedTree", "AdditiveOperation"))
169)]
170mod range_frequency;
171#[cfg_attr(nightly, codesnip::entry("RangeMap"))]
172mod range_map;
173#[cfg_attr(nightly, codesnip::entry("RangeMinimumQuery"))]
174mod range_minimum_query;
175#[cfg_attr(
176 nightly,
177 codesnip::entry("SegmentTree", include("algebra", "discrete_steps"))
178)]
179mod segment_tree;
180#[cfg_attr(
181 nightly,
182 codesnip::entry("SegmentTreeMap", include("algebra", "discrete_steps"))
183)]
184mod segment_tree_map;
185#[cfg_attr(
186 nightly,
187 codesnip::entry("sliding_window_aggregation", include("algebra"))
188)]
189mod sliding_window_aggregation;
190#[cfg_attr(nightly, codesnip::entry("slope_trick"))]
191mod slope_trick;
192#[cfg_attr(nightly, codesnip::entry("SparseSet"))]
193mod sparse_set;
194#[cfg_attr(
195 nightly,
196 codesnip::entry("SplayTree", include("Allocator", "LazyMapMonoid"))
197)]
198pub mod splay_tree;
199#[cfg_attr(
200 nightly,
201 codesnip::entry("SubmaskRangeQuery", include("algebra", "BitDp", "Xorshift"))
202)]
203pub mod submask_range_query;
204#[cfg_attr(
205 nightly,
206 codesnip::entry(
207 "transducer",
208 include("algebra", "container", "VecMap", "digit_sequence")
209 )
210)]
211mod transducer;
212#[cfg_attr(
213 nightly,
214 codesnip::entry("Treap", include("binary_search_tree", "Xorshift"))
215)]
216pub mod treap;
217#[cfg_attr(nightly, codesnip::entry("Trie", include("algebra")))]
218mod trie;
219#[cfg_attr(
220 nightly,
221 codesnip::entry("UnionFind", include("algebra", "TupleOperation"))
222)]
223pub mod union_find;
224#[cfg_attr(nightly, codesnip::entry("VecMap", include("container")))]
225mod vec_map;
226#[cfg_attr(
227 nightly,
228 codesnip::entry("WaveletMatrix", include("BitVector", "compress", "algebra"))
229)]
230mod wavelet_matrix;