diff --git a/library/mrpython/typical_segment_tree.hpp b/library/mrpython/typical_segment_tree.hpp index 25228f6..2bc5628 100644 --- a/library/mrpython/typical_segment_tree.hpp +++ b/library/mrpython/typical_segment_tree.hpp @@ -90,5 +90,18 @@ template using typical_segment_tree_max = typical_segment_tree; template using typical_segment_tree_min = typical_segment_tree; + +template class typical_segment_tree_from_node { + using T = typename NodeStruct::T; + struct MergeFunction { + T operator()(T const& a, T const& b) const { + return NodeStruct::merge_data(a, b); + } + }; + typical_segment_tree_from_node() = delete; + + public: + using type = typical_segment_tree; +}; } // namespace mrpython #endif // MP_LIBRARY_SEGMENT_TREE_HPP diff --git a/package.json b/package.json index 1fa0f86..6d4f70a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "mp-oi-library", "displayName": "mp-oi-library", "description": "Some algorithms and data structures template for competitive programming.", - "version": "0.2.1", + "version": "0.2.2", "repository": "https://github.com/Mr-Python-in-China/mp-oi-library", "license": "LGPL-3.0-only", "author": {