From a9a1c3936945c9cf1e218e14d05afb93bc1a8603 Mon Sep 17 00:00:00 2001 From: oitl-5ab <61768808+oitl-5ab@users.noreply.github.com> Date: Sun, 13 Sep 2020 11:06:20 +0800 Subject: [PATCH 1/5] Delete Useless Files --- disjoint_set | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 disjoint_set diff --git a/disjoint_set b/disjoint_set deleted file mode 100644 index 37a5ad0..0000000 --- a/disjoint_set +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef OITL_DISJOINT_SET -#define OITL_DISJOINT_SET 1 - -#include "assets/oitl_basic.hpp" -#include "assets/disjoint_set.hpp" -#include "assets/presistent_disjoint_set.hpp" - -#endif \ No newline at end of file From 40117b30a3b94b2861763944b17ba48553711c29 Mon Sep 17 00:00:00 2001 From: oitl-5ab <61768808+oitl-5ab@users.noreply.github.com> Date: Wed, 16 Sep 2020 19:32:49 +0800 Subject: [PATCH 2/5] Updated on Indev-1.0 Indev-1.0: renamed some functions and wrote guides and wikis. --- guide.md | 285 ++++++++++++++++++++++++++---------------------------- update.md | 54 +++++------ 2 files changed, 162 insertions(+), 177 deletions(-) diff --git a/guide.md b/guide.md index 6946d40..fa65ad2 100644 --- a/guide.md +++ b/guide.md @@ -1,146 +1,139 @@ -[toc] - -# Olympiad in Informatics Template Library Using Guide | OI 标准库 使用指南 - -## Simpified Chinese | 简体中文版 -`OITL` 是一个由众多算法和数据结构所构成的一些库的统称。 - -想要玩转 `OITL`?看这里! - -下面将会讲述不同库、类和函数的用法。 - -注:所有的类和函数都是在 `oitl` 名字空间下的。 -### oitl/segment_tree (Not finished.) -这个库里面有各种各样的线段树。 -#### class segment_tree | oitl/assets/segment_tree.hpp -最基本的线段树,基于递归式线段树实现。 - -定义:`template > class segment_tree` - -- `int __s`:指区间长度; -- `typename __vtype`:指存储类型; -- `typename __calc`:指要进行区间的运算 - -方法: - -> `segment_tree<__s, __vtype, __calc>::segment_tree()`(构造函数) - -构造一个长度为 `__s`,初始值为 `__vtype()` 的区间。 - -> `segment_tree<__s, __vtype, __calc>::segment_tree(__vtype *arr)`(构造函数) - -将 `arr` 中的值复制到线段树内,并且通过 `__calc::operator()` 构建树。 - -> `void segment_tree<__s, __vtype, __calc>::modify(__id_type __id, __vtype __v)`(单点修改) - -将第 `__id` 个元素的值 `__ov` 赋为 `__v`。 - -> `void segment_tree<__s, __vtype, __calc>::modify(__id_type __lp, __id_type __rp, __vtype __v)`(区间修改) - -将第 `__lp` 个元素到第 `__rp` 个元素都赋为 **`__calc::operator(__ov, __v)`**。 - -> `const __vtype segment_tree<__s, __vtype, __calc>::query(__id_type __id)`(单点查询) - -询问第 `__id` 个数的值。 - -> `const __vtype segment_tree<__s, __vtype, __calc>::query(__id_type __lp, __id_type __rp)`(区间查询) - -询问从第 `__lp` 个到 `__rp` 的 `__calc` 值。 - -#### class nontag_segment_tree | oitl/assets/segment_tree.hpp -与 `segment_tree` 类似,但是不打懒标记,也就是不支持区间修改。 - -定义等与 `segment_tree` 类似,不再赘述了。 -#### class presistent_basic_segment_tree | oitl/assets/presistent_segment_tree.hpp -基本的线段树可持久化,就是 `nontag_segment_tree` 的可持久化版本。 - -定义:同 `nontag_segment_tree`。 - -方法: - -> `presistent_basic_segment_tree<__s, __vtype, __calc>::presistent_basic_segment_tree()`(构造函数) - -构造一个长度为 `__s`,初始值为 `__vtype()` 的区间。 - -> `presistent_basic_segment_tree<__s, __vtype, __calc>::presistent_basic_segment_tree(__vtype *arr)`(构造函数) - -将 `arr` 中的值复制到线段树内,并且通过 `__calc::operator()` 构建树。 - -> `const __id_type presistent_basic_segment_tree<__s, __vtype, __calc>::modify(__id_type __id, __vtype __v, __id_type __ver_from)`(单点修改) - -将第 `__ver_from` 个版本的第 `__id` 个元素的值 `__ov` 修改成 `__v`,返回成功后的版本号。若不成功,返回 `-1`。 - -> `const __vtype presistent_basic_segment_tree<__s, __vtype, __calc>::query(__id_type __id, __id_type __ver_from)`(单点查询) - -查询第 `__ver_from` 个版本的第 `__id` 个值。 - -> `const __vtype presistent_basic_segment_tree<__s, __vtype, __calc>::query(__id_type __lp, __id_type __rp, __id_type __ver_from)`(区间查询) - -查询第 `__ver_from` 个版本从 `__lp` 到 `__rp` 的值。 - -> `const __id_type presistent_basic_segment_tree<__s, __vtype, __calc>::copy_ver_from(__id_type __ver_from)` - -从第 `__ver_from` 拷贝一个新版本,成功则返回版本号,失败返回 `-1`。 - -> `const void presistent_basic_segment_tree<__s, __vtype, __calc>::inver_modify(__id_type __id, __vtype __v, __id_type __ver_from)` -> -> `const __vtype presistent_basic_segment_tree<__s, __vtype, __calc>::inver_query(__id_type __id, __id_type __ver_from)` -> -> `const __vtype presistent_basic_segment_tree<__s, __vtype, __calc>::inver_query(__id_type __lp, __id_type __rp, __id_type __ver_from)` - -方法与对应的功能类似,只不过是在一个版本内进行修改,并不进行版本复制。 - -#### class presistent_segment_tree | oitl/assets/presistent_segment_tree.hpp -就是支持了区间修改的线段树可持久化。类似。 - -#### class chairman_tree | oitl/assets/presistent_segment_tree.hpp -你们要的主席树! - -定义:`template class chairman_tree` - -- `int __s`:区间大小。 -- `typename __vtype`:存储类型,必须是数。 - -方法: - -> `chairman_tree<__s, __vtype>::chairman_tree()` - -构造一个长度为 `__s`,初始值为 `__vtype()` 的区间。 - -> `chairman_tree<__s, __vtype>::chairman_tree(__vtype *arr)` - -将 `arr` 中的值复制到主席树内,并且通过 `min` 运算建树。 - -> `void charirman_tree<__s, __vtype>::rebuild(__vtype *arr)` - -同上。 - -> `__vtype chairman_tree<__s, __vtype>::nth_number(__id_type __lp, __id_type __rp, __id_type __rk)` - -求出从 `__lp` 到 `__rp` 里的第 `__rk` 大。 - -### oitl/sparse_table (Not finished.) - -稀疏表(ST 表),一种高效的 RMQ 实现方案。 - -#### class sparse_table | oitl/assets/sparse_table.hpp - -定义:`template class sparse_table` - -- `int __s`:区间大小 -- `typename __vtype`:存储值 -- `typename __calc`:区间运算类型 - -#### class directed_graph / indirected_graph (Not finished.) -### oitl/binary_indexed_tree (State 1/3) -#### class binary_indexed_tree | oitl/assets/binary_indexed_tree.hpp - -定义:`template class binary_indexed_tree` - -- `int _N`:区间大小; -- `typename _Val_t`:存储值类型; -- `typename _Op`:运算。 - -## English | 英语版 - -征求翻译…… +# OITL 使用指南 +这里介绍了 OITL 各个东西的使用指南。 +## 树状数组 +简单易懂,支持单点修改,区间查询。 +### binary_indexed_tree +最基本的树状数组。支持单点修改和区间询问。 + +定义:`template class binary_indexed_tree`。 + +- `int _N`:区间大小; +- `class _Val_t`:存储数据类型; +- `class _Op`:支持的运算。(树状数组支持满足结合律的运算) + +### 类型 +`binary_indexed_tree<_N, _Val_t, _Op>::value_type`:存储类型(aka. `_Val_t`); + +`binary_indexed_tree<_N, _Val_t, _Op>::operate_type`:运算类型(aka. `_Op`)。 +### 成员函数 +#### binary_indexex_tree +定义:`binary_indexed_tree<_N, _Val_t, _Op>::binary_indexed_tree(value_type identity)`(构造函数)。 + +可以构造一个元素均为 `identity` 初始的树状数组。 + +参数: + +- `value_type identity`:即单位元。 + +无返回值。 +#### modify +定义:`void binary_indexed_tree<_N, _Val_t, _Op>::modify(int ptr, value_type val)`。 + +进行单点修改,在 `ptr` 的位置上 _加上_ `val`。 + +参数: + +- `int ptr`:位置指针(从 0 开始); +- `value_type val`:修改值。 + +无返回值。 +#### query +定义:`value_type binary_indexed_tree<_N, _Val_t, _Op>::query(int qr)`。 + +区间询问 [0,qr] 的值的 _和_。 + +参数: + +- `int qr`:位置指针(从 0 开始)。 + +返回值:询问答案。 +## 并查集 +就是简单的并查集,支持快速的合并集合和询问集合。 +### disjoint_set_union +最基本的并查集,可以完成所有基本并查集的功能。 + +定义:`class disjoint_set_union`。 +### 成员函数 +#### disjoint_set_union +定义:`disjoint_set_union::disjoint_set_union(int size = 0)`(构造函数)。 + +构造一个大小为 `size` 的并查集。 + +参数: + +- `int size`:并查集初始大小。 + +无返回值。 +#### empty +定义:`bool disjoint_set_union::empty() const`。 + +询问并查集内是否为空。 + +无参数。 + +返回值:如果为空,返回 `true`,否则为 `false`。 +#### size +定义:`int disjoint_set_union::size() const`。 + +询问并查集的大小。 + +无参数。 + +返回值:并查集的大小。 +#### clear +定义:`void disjoint_set_union::clear()`。 + +删除并查集内所有元素。 + +无参数,无返回值。 +#### reset +定义:`void disjoint_set_union::reset()`。 + +重设并查集内所有元素,即将所有元素分离。 + +无参数,无返回值。 +#### resize +定义:`void disjoint_set_union::resize(int size)`。 + +重新设置并查集大小。 + +如果输入值比原来大小更大,那么就新插入节点直到大小相同。 + +否则,删除多余的节点。**不保证不会运行时错误,请谨慎使用。** + +参数: + +- `int size`:重设后的并查集大小。 + +无返回值。 +#### add_element +定义:`int disjoint_set_union::add_element()`。 + +插入一个新的并查集元素。 + +无参数。 + +返回值:新的元素的编号。(下标从 0 开始,下同) +#### unite +定义:`void disjoint_set_union::unite(int a, int b)`。 + +将 `a` 和 `b` 分别所在的集合合并。 + +参数: + +- `int a`:第一个元素; +- `int b`:第二个元素。 + +无返回值。 +#### same_set +定义:`bool disjoint_set_union::same_set(int a, int b)`。 + +查询 `a` 和 `b` 是否在一个集合内。 + +参数: + +- `int a`:第一个元素; +- `int b`:第二个元素。 + +无返回值。 +# Guides for OITL classes and functions \ No newline at end of file diff --git a/update.md b/update.md index 740c12c..525fa0d 100644 --- a/update.md +++ b/update.md @@ -1,31 +1,23 @@ -# Update Log - -## v1.0 - -Welcome using OITL to programming! - -OITL is a source-open project which means you can join our development! - -Only use GitHub and Pull-Request, you can make OITL better! - -p.s. `guide.md` may exists some other classes. It may show what I'll update next time (^_^). - ---- - -New features: - -Added `class segment_tree` ! - -p.s. You shouldn't use the libraries that I didn't mentioned in the update log. These functions or classes are under construction, so they are really not stable. If you use it, you may meet some strange bugs.(Even Compilation Error ^_^) - -### Full update log in v1.0 - -#### v1.0.0 Pre-test Upd_1 - -Constructing. - -Started the reconstruction of recursive-segment_tree. - -#### v1.0.0 Pre-test Upd_0 - -construct classes. \ No newline at end of file +# OITL Update Log +It's the full update log of OITL. + +## Indev (v0) +In-DEV state. The first state of OITL Development. We would like to add as many classes and functions as we could. +### Indev-0 +Indev-0, the first released version of OITL. +#### Indev-0.0 +Added `binary_indexed_tree` into OITL. It means that OITL got its first class. +#### Indev-0.1 +Fixed some bugs of `binary_indexed_tree`. + +Added `disjoint_set_union`. +### Indev-1 +The second released version of OITL and the In-DEV state. +#### Indev-1.0 +Renamed some functions. + +- `disjoint_set_union::clear()` was renamed `disjoint_set_union::reset()`; +- `disjoint_set_union::reset()` was renamed `disjoint_set_union::clear()`; +- `disjoint_set_union::unite_sets()` was renamed `disjoint_set_union::unite()`. + +Wrote Guides and Wikis and filled update logs. \ No newline at end of file From 7e524ddfcb8258cff99ce60d1f1263674d4429f1 Mon Sep 17 00:00:00 2001 From: oitl-5ab <61768808+oitl-5ab@users.noreply.github.com> Date: Wed, 16 Sep 2020 19:35:19 +0800 Subject: [PATCH 3/5] Updated on Indev-1.0 --- tests/Test-binary_indexed_tree.exe | Bin 59643 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/Test-binary_indexed_tree.exe diff --git a/tests/Test-binary_indexed_tree.exe b/tests/Test-binary_indexed_tree.exe deleted file mode 100644 index 016f5eb09747cbc8f60fb57be568c0c4339b1ee1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 59643 zcmeFa3t$xGxi>zu*(3`I*$o6ljk@5fpb(OfM9`oK$%aI7GZ!ujF1c)AH6(E}3qe6* zH&N!SsX49Z9NXG@ZL8<=Yptb#mct1I3HDeU5iM2PQpI*-&{Cwxt?c)E-ghoL*(6*} zzjMC-|2Qz2ncw@|-sgSZ>&(uS+|?~a34&n89tsJ#1IMHMm=74Ag_VI$yk6o}~FUL;S(K%?zZV@{j*;bA# zTm<7qmM=lDb6R2`9&E~iU%Uc+G5qvW{+jy*Ve&AHEk6;2lf&RDlp?v?BwTFD!XGk- z@~UM5=h#*VSGacnPL7s(d>|tAuklK^t<%DNrk+1^01^aE-!#2?6%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P-@bCtGpth!EI3w)z$lJL5sa!_!;6p?)^BTmrX}C6-U+X|En5E8W zwW%P-nJKGzqjLB;^3w)^D4Va!n+4<{si>KeMFwnPz}lAl8j|k3@n{6s45DP2YgtArYf!c@R8APNz{gg zBbO*!ZVpDZ%xW ogo{QoaOW#K!Wlbe5zlwT5%wanHCy1+&Yji)?P66TmLH(_2d`E`^8f$< From 46a7ed02080a813cb342c0dfdaa9fd4459d8f14a Mon Sep 17 00:00:00 2001 From: 5ABInGit Date: Fri, 18 Sep 2020 22:57:08 +0800 Subject: [PATCH 4/5] Updated on Indev-1.1 Indev-1.1 Updates: 1. Added sparse_table. 2. Fixed bugs. --- assets/binary_indexed_tree.hpp | 2 +- assets/disjoint_set_union.hpp | 17 ++++-- assets/sparse_table.hpp | 103 +++++++++++++++++++++++++-------- sparse_table | 7 +-- tests/Test-sparse_table.cpp | 38 ++++++++++++ update.md | 6 +- 6 files changed, 139 insertions(+), 34 deletions(-) create mode 100644 tests/Test-sparse_table.cpp diff --git a/assets/binary_indexed_tree.hpp b/assets/binary_indexed_tree.hpp index 37e1c15..4635d51 100644 --- a/assets/binary_indexed_tree.hpp +++ b/assets/binary_indexed_tree.hpp @@ -57,7 +57,7 @@ namespace oitl public: - binary_indexed_tree(value_type _Identity = value_type(0)) : __identity(_Identity) + explicit binary_indexed_tree(value_type _Identity = value_type(0)) : __identity(_Identity) { #if __cplusplus >= 201103L __bit.fill(__identity); diff --git a/assets/disjoint_set_union.hpp b/assets/disjoint_set_union.hpp index d361f0a..f796301 100644 --- a/assets/disjoint_set_union.hpp +++ b/assets/disjoint_set_union.hpp @@ -21,7 +21,7 @@ namespace oitl public: - disjoint_set_union(int __siz = 0) + explicit disjoint_set_union(int __siz = 0) { __dsu.resize(__siz); for (register int __i = 0; __i < __siz; ++__i) @@ -30,14 +30,14 @@ namespace oitl bool empty() const { return __dsu.size() == 0; } int size() const { return __dsu.size(); } - void reset() { __dsu.clear(); } + void clear() { __dsu.clear(); } bool same_set(int __ap, int __bp) { return _Find_root(__ap) == _Find_root(__bp); } - void unite_sets(int __ap, int __bp) + void unite(int __ap, int __bp) { if (same_set(__ap, __bp)) return; @@ -51,7 +51,7 @@ namespace oitl return __dsu.size() - 1; } - void clear() + void reset() { for (register int __i = 0; __i < __dsu.size(); ++__i) __dsu[__i] = __i; @@ -65,7 +65,16 @@ namespace oitl __dsu.push_back(__i); } else + { + for (register int __i = 0; __i < __siz; ++__i) + if (_Find_root(__i) >= __siz) + { + __dsu[_Find_root(__i)] = __i; + __dsu[__i] = __i; + } + __dsu.resize(__siz); + } } }; } diff --git a/assets/sparse_table.hpp b/assets/sparse_table.hpp index 2c702ee..4a452b8 100644 --- a/assets/sparse_table.hpp +++ b/assets/sparse_table.hpp @@ -1,39 +1,94 @@ -#ifndef OITL_SPARSE_TABLE_HPP -#define OITL_SPARSE_TABLE_HPP +#ifndef _OITL_ASSETS_SPARSE_TABLE +#define _OITL_ASSETS_SPARSE_TABLE 1 #include +#if __cplusplus >= 201103L +#include +#endif + namespace oitl { - template - class sparse_table - { - private: + namespace __oitl_builtin + { + template + class _Pow_tab + { + private: + + #if __cplusplus >= 201103L + std::array __val; + #else + int __val[_N]; + #endif + + public: + + _Pow_tab() + { + int __lay = 0, __pw = 1; + + for (register int __i = 0; __i < _N; ++__i) + { + __val[__i] = __lay; + + if (__pw == __i) + ++__lay, __pw <<= 1; + } + } + + int operator[](int id) + { + return __val[id]; + } + }; + } + + template + class sparse_table + { + public: + + typedef _Val_t value_type; + typedef _Op operate_type; + + private: + + std::vector > __tab; + __oitl_builtin::_Pow_tab<_N> __ask; - struct __line - { - __id_type __up; - val_t __rmq[n]; - }; + operate_type __calc; + + public: - std::vector<__line> __tab; + sparse_table() { } - template - void build(it __l, it __r) - { + template + void refill(_Iterator __lp) + { + register int __cra = 1, __ptr = 0, __tar = 0; - } - - public: + __tab.push_back(vector(_N)); + __tab[0].assign(__lp, __lp + _N); - sparse_table() { } - sparse_table(const sparse_table& __st) - { + while (__tab[__ptr].size() > __cra) + { + ++__ptr; + __tab.push_back(vector()); - } + for (register int __i = __cra; __i < __tab[__tar].size(); ++__i) + __tab[__ptr][__i] = __calc(__tab[__tar][__i-__cra], __tab[__tar][__i]); + + ++__tar; + } + } - ~sparse_table() { } - }; + value_type query(int __lp, int __rp) const + { + return __calc(__tab[__ask[__rp-__lp]][__lp] + __tab[__ask[__rp-__lp]][__rp-(1<<__ask[__rp-__lp])]); + } + }; } #endif \ No newline at end of file diff --git a/sparse_table b/sparse_table index bddbe5b..23381cd 100644 --- a/sparse_table +++ b/sparse_table @@ -1,7 +1,6 @@ -#ifndef OITL_SPARSE_TABLE -#define OITL_SPARSE_TABLE 1 +#ifndef _OITL_SPARSE_TABLE_LIB +#define _OITL_SPARSE_TABLE_LIB 1 -#include "assets/oitl_basic.hpp" #include "assets/sparse_table.hpp" -#endif +#endif \ No newline at end of file diff --git a/tests/Test-sparse_table.cpp b/tests/Test-sparse_table.cpp new file mode 100644 index 0000000..2a86ecf --- /dev/null +++ b/tests/Test-sparse_table.cpp @@ -0,0 +1,38 @@ +#include "../sparse_table" +#include +using namespace std; + +const int max_n = 1000, max_q = 100; +int arr[max_n], mn[max_n]; + +struct get_min +{ + int operator()(int a, int b) { return (a < b)? a:b; } +}; + +int main() +{ + sparse_table st; + default_random_engine ds; + uniform_int_distribution ug; + get_min calc; + + for (int i = 0; i < max_n; i++) + { + arr[i] = ug(ds); + if (i > 0) + mn[i] = calc(arr[i], mn[i-1]); + } + + st.refill(arr); + + for (int i = 1; i <= max_q; i++) + { + if (mn[i] != st.query(0, i - 1)); + printf("Unaccepted on Test #%02d. Expected %d but found %d.\n", mn[i], st.query(0, i - 1)); + else + printf("Accepted on Test #%02d.\n") + } + + return 0; +} \ No newline at end of file diff --git a/update.md b/update.md index 525fa0d..e5a04e5 100644 --- a/update.md +++ b/update.md @@ -20,4 +20,8 @@ Renamed some functions. - `disjoint_set_union::reset()` was renamed `disjoint_set_union::clear()`; - `disjoint_set_union::unite_sets()` was renamed `disjoint_set_union::unite()`. -Wrote Guides and Wikis and filled update logs. \ No newline at end of file +Wrote Guides and Wikis and filled update logs. +#### Indev-1.1 +Fixed the bug of `disjoint_set_union` about resizing. + +Added `sparse_table`(Not Tested, Wikis and guides will update after testing). \ No newline at end of file From 5893a0feedba4a6c8cb80fe472486dba4a6bf110 Mon Sep 17 00:00:00 2001 From: 5ABInGit Date: Sat, 19 Sep 2020 16:55:27 +0800 Subject: [PATCH 5/5] Updated on Indev-1.1 Fixed bugs of sparse_table. Some few changes of old libraries. --- assets/bad_assert.hpp | 6 ++-- assets/decimal.hpp | 0 assets/disjoint_set.hpp | 68 ------------------------------------- assets/longint.hpp | 0 assets/oitl_basic.hpp | 4 +-- assets/sparse_table.hpp | 27 +++++++++------ guide.md | 45 ++++++++++++++++-------- high_precision | 7 ---- presistents | 12 ------- tests/Test-sparse_table.cpp | 15 ++++---- 10 files changed, 60 insertions(+), 124 deletions(-) delete mode 100644 assets/decimal.hpp delete mode 100644 assets/disjoint_set.hpp delete mode 100644 assets/longint.hpp delete mode 100644 high_precision delete mode 100644 presistents diff --git a/assets/bad_assert.hpp b/assets/bad_assert.hpp index aa6f7be..6e4dbe1 100644 --- a/assets/bad_assert.hpp +++ b/assets/bad_assert.hpp @@ -15,7 +15,7 @@ namespace oitl public: - std_error(const std::string &_s = "") : s("[OI Template Library] " + _s) { } + std_error(const std::string &_s = "") : s("[OITL] " + _s) { } ~std_error() { s.clear(); } const char* what() { return s.c_str(); } @@ -32,7 +32,7 @@ namespace oitl template void __oitl_range_assert(const T &a, const T &b) { - __oitl_assert(a <= b, "Input not make a range."); + __oitl_assert(a <= b, "Input do not make a range."); } // Check the range [l, r] @@ -44,7 +44,7 @@ namespace oitl void __oitl_array_assert(const int& len, const int& id) { - __oitl_assert(id >= 0 && len > id, "Visit out of array."); + __oitl_assert(id >= 0 && len > id, "Not a vaild index."); } } diff --git a/assets/decimal.hpp b/assets/decimal.hpp deleted file mode 100644 index e69de29..0000000 diff --git a/assets/disjoint_set.hpp b/assets/disjoint_set.hpp deleted file mode 100644 index d1fe3a5..0000000 --- a/assets/disjoint_set.hpp +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef OITL_DISJOINT_SET_HPP -#define OITL_DISJOINT_SET_HPP 1 - -#include "bad_assert.hpp" -#include - -namespace oitl -{ - class disjoint_set - { - private: - - std::vector<__id_type> __v; - - __id_type __find(__id_type __id) - { - if (__v[__id] != __id) - __v[__id] = __find(__v[__id]); - - return __v[__id]; - } - - public: - - disjoint_set(__id_type __size = 0) - { - __v.resize(__size); - - for (int __i = 0; __i < __size; ++__i) - __v[__i] = __i; - } - disjoint_set(const disjoint_set& __ds) { __v.assign(__ds.__v.begin(), __ds.__v.end()); } - ~disjoint_set() { } - - void resize(__id_type __nsize) - { - __oitl_assert(__nsize > __v.size(), "Not enough spaces."); - __v.resize(__id_type); - } - - void clear() { __v.clear(); } - bool is_lone(__id_type __i) const - { - __oitl_array_assert(__v.size(), __i); - return __v[__i] == __i; - } - bool is_same(__id_type __id1, __id_type __id2) - { - __oitl_array_assert(__v.size(), __id1); - __oitl_array_assert(__v.size(), __id2); - - return __find(__id1) == __find(__id2); - } - - void unite(__id_type __id1, __id_type __id2) - { - __oitl_array_assert(__v.size(), __id1); - __oitl_array_assert(__v.size(), __id2); - - if (is_same(__id1, __id2)) - return; - - __v[__find(__id1)] = __find(__id2); - } - }; -} - -#endif diff --git a/assets/longint.hpp b/assets/longint.hpp deleted file mode 100644 index e69de29..0000000 diff --git a/assets/oitl_basic.hpp b/assets/oitl_basic.hpp index 99cc075..38c5eb9 100644 --- a/assets/oitl_basic.hpp +++ b/assets/oitl_basic.hpp @@ -1,5 +1,5 @@ -#ifndef OITL_BASIC_HPP -#define OITL_BASIC_HPP +#ifndef _OITL_ASSETS_BASIC +#define _OITL_ASSETS_BASIC 1 #define OITL_UPD 20200309L diff --git a/assets/sparse_table.hpp b/assets/sparse_table.hpp index 4a452b8..cf08623 100644 --- a/assets/sparse_table.hpp +++ b/assets/sparse_table.hpp @@ -26,18 +26,18 @@ namespace oitl _Pow_tab() { - int __lay = 0, __pw = 1; + int __lay = -1, __pw = 1; for (register int __i = 0; __i < _N; ++__i) { - __val[__i] = __lay; - if (__pw == __i) ++__lay, __pw <<= 1; + + __val[__i] = __lay; } } - int operator[](int id) + int operator[](int id) const { return __val[id]; } @@ -67,25 +67,30 @@ namespace oitl void refill(_Iterator __lp) { register int __cra = 1, __ptr = 0, __tar = 0; + _Iterator __rp = __lp; - __tab.push_back(vector(_N)); - __tab[0].assign(__lp, __lp + _N); + __tab.clear(); + __tab.push_back(std::vector(_N)); + + for (register int __i = 0; __i < _N; ++__i) + ++__rp; + __tab[0].assign(__lp, __rp); while (__tab[__ptr].size() > __cra) { ++__ptr; - __tab.push_back(vector()); + __tab.push_back(std::vector()); for (register int __i = __cra; __i < __tab[__tar].size(); ++__i) - __tab[__ptr][__i] = __calc(__tab[__tar][__i-__cra], __tab[__tar][__i]); - - ++__tar; + __tab[__ptr].push_back(__calc(__tab[__tar][__i-__cra], __tab[__tar][__i])); + + ++__tar, __cra <<= 1; } } value_type query(int __lp, int __rp) const { - return __calc(__tab[__ask[__rp-__lp]][__lp] + return __calc(__tab[__ask[__rp-__lp]][__lp], __tab[__ask[__rp-__lp]][__rp-(1<<__ask[__rp-__lp])]); } }; diff --git a/guide.md b/guide.md index fa65ad2..795f0be 100644 --- a/guide.md +++ b/guide.md @@ -11,12 +11,12 @@ - `class _Val_t`:存储数据类型; - `class _Op`:支持的运算。(树状数组支持满足结合律的运算) -### 类型 +#### 类型 `binary_indexed_tree<_N, _Val_t, _Op>::value_type`:存储类型(aka. `_Val_t`); `binary_indexed_tree<_N, _Val_t, _Op>::operate_type`:运算类型(aka. `_Op`)。 -### 成员函数 -#### binary_indexex_tree +#### 成员函数 +##### binary_indexex_tree 定义:`binary_indexed_tree<_N, _Val_t, _Op>::binary_indexed_tree(value_type identity)`(构造函数)。 可以构造一个元素均为 `identity` 初始的树状数组。 @@ -26,7 +26,7 @@ - `value_type identity`:即单位元。 无返回值。 -#### modify +##### modify 定义:`void binary_indexed_tree<_N, _Val_t, _Op>::modify(int ptr, value_type val)`。 进行单点修改,在 `ptr` 的位置上 _加上_ `val`。 @@ -37,7 +37,7 @@ - `value_type val`:修改值。 无返回值。 -#### query +##### query 定义:`value_type binary_indexed_tree<_N, _Val_t, _Op>::query(int qr)`。 区间询问 [0,qr] 的值的 _和_。 @@ -53,8 +53,8 @@ 最基本的并查集,可以完成所有基本并查集的功能。 定义:`class disjoint_set_union`。 -### 成员函数 -#### disjoint_set_union +#### 成员函数 +##### disjoint_set_union 定义:`disjoint_set_union::disjoint_set_union(int size = 0)`(构造函数)。 构造一个大小为 `size` 的并查集。 @@ -64,7 +64,7 @@ - `int size`:并查集初始大小。 无返回值。 -#### empty +##### empty 定义:`bool disjoint_set_union::empty() const`。 询问并查集内是否为空。 @@ -72,7 +72,7 @@ 无参数。 返回值:如果为空,返回 `true`,否则为 `false`。 -#### size +##### size 定义:`int disjoint_set_union::size() const`。 询问并查集的大小。 @@ -80,19 +80,19 @@ 无参数。 返回值:并查集的大小。 -#### clear +##### clear 定义:`void disjoint_set_union::clear()`。 删除并查集内所有元素。 无参数,无返回值。 -#### reset +##### reset 定义:`void disjoint_set_union::reset()`。 重设并查集内所有元素,即将所有元素分离。 无参数,无返回值。 -#### resize +##### resize 定义:`void disjoint_set_union::resize(int size)`。 重新设置并查集大小。 @@ -106,7 +106,7 @@ - `int size`:重设后的并查集大小。 无返回值。 -#### add_element +##### add_element 定义:`int disjoint_set_union::add_element()`。 插入一个新的并查集元素。 @@ -114,7 +114,7 @@ 无参数。 返回值:新的元素的编号。(下标从 0 开始,下同) -#### unite +##### unite 定义:`void disjoint_set_union::unite(int a, int b)`。 将 `a` 和 `b` 分别所在的集合合并。 @@ -125,7 +125,7 @@ - `int b`:第二个元素。 无返回值。 -#### same_set +##### same_set 定义:`bool disjoint_set_union::same_set(int a, int b)`。 查询 `a` 和 `b` 是否在一个集合内。 @@ -136,4 +136,19 @@ - `int b`:第二个元素。 无返回值。 +## 稀疏表(ST 表) +一种非常高效的 RMQ 数据结构,可以达到 O(n log n)-O(1) 的优秀复杂度。 +### sparse_table +不支持修改的普通 ST 表。 + +定义:`template class sparse_table`。 + +- `int _N`:区间大小; +- `class _Val_t`:存储类型; +- `class _Op`:运算。 + +#### 成员函数 +##### sparse_table +定义: + # Guides for OITL classes and functions \ No newline at end of file diff --git a/high_precision b/high_precision deleted file mode 100644 index bab1ca4..0000000 --- a/high_precision +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef OITL_HIGH_PRECISION -#define OITL_HIGH_PRECISION - -#include "assets/longint.hpp" -#include "assets/decimal.hpp" - -#endif \ No newline at end of file diff --git a/presistents b/presistents deleted file mode 100644 index 4bc8914..0000000 --- a/presistents +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef OITL_PRESISTENTS -#define OITL_PRESISTENTS - -#include "oitl_basic.hpp" -#include "bad_assert.hpp" - -#include "assets/presistent_segment_tree.hpp" -#include "assets/presistent_array.hpp" -#include "assets/presistent_disjoint_set.hpp" -#include "assets/presistent_trie.hpp" - -#endif \ No newline at end of file diff --git a/tests/Test-sparse_table.cpp b/tests/Test-sparse_table.cpp index 2a86ecf..4b54c11 100644 --- a/tests/Test-sparse_table.cpp +++ b/tests/Test-sparse_table.cpp @@ -1,5 +1,5 @@ -#include "../sparse_table" #include +#include "../sparse_table" using namespace std; const int max_n = 1000, max_q = 100; @@ -7,12 +7,12 @@ int arr[max_n], mn[max_n]; struct get_min { - int operator()(int a, int b) { return (a < b)? a:b; } + int operator()(int a, int b) const { return (a < b)? a:b; } }; int main() { - sparse_table st; + oitl::sparse_table st; default_random_engine ds; uniform_int_distribution ug; get_min calc; @@ -20,18 +20,21 @@ int main() for (int i = 0; i < max_n; i++) { arr[i] = ug(ds); + if (i > 0) mn[i] = calc(arr[i], mn[i-1]); + else + mn[i] = arr[i]; } st.refill(arr); for (int i = 1; i <= max_q; i++) { - if (mn[i] != st.query(0, i - 1)); - printf("Unaccepted on Test #%02d. Expected %d but found %d.\n", mn[i], st.query(0, i - 1)); + if (mn[i] != st.query(0, i + 1)) + printf("Unaccepted on Test #%02d. In range [1,%d]. Expected %d but found %d.\n", i, i, mn[i], st.query(0, i + 1)); else - printf("Accepted on Test #%02d.\n") + printf("Accepted on Test #%02d. ok the answer is %d\n", i, mn[i]); } return 0;