Struct cp_library_rs::data_structure::mex_set::MexSet
source · pub struct MexSet {
pub ranges: BTreeSet<(isize, isize)>,
}
Expand description
集合とそのmexを管理する
Fields§
§ranges: BTreeSet<(isize, isize)>
Implementations§
source§impl MexSet
impl MexSet
sourcepub fn insert_range<R: RangeBounds<isize>>(&mut self, range: R) -> bool
pub fn insert_range<R: RangeBounds<isize>>(&mut self, range: R) -> bool
集合に区間を追加する
- 計算量: O(log(n)) (amotized)
sourcepub fn delete_range<R: RangeBounds<isize>>(&mut self, range: R) -> bool
pub fn delete_range<R: RangeBounds<isize>>(&mut self, range: R) -> bool
集合から区間を削除する
- 計算量: O(log(n)) (amotized)