File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -90,5 +90,18 @@ template <typename T>
9090using typical_segment_tree_max = typical_segment_tree<T, max>;
9191template <typename T>
9292using typical_segment_tree_min = typical_segment_tree<T, min>;
93+
94+ template <typename NodeStruct> class typical_segment_tree_from_node {
95+ using T = typename NodeStruct::T;
96+ struct MergeFunction {
97+ T operator ()(T const & a, T const & b) const {
98+ return NodeStruct::merge_data (a, b);
99+ }
100+ };
101+ typical_segment_tree_from_node () = delete ;
102+
103+ public:
104+ using type = typical_segment_tree<T, MergeFunction>;
105+ };
93106} // namespace mrpython
94107#endif // MP_LIBRARY_SEGMENT_TREE_HPP
Original file line number Diff line number Diff line change 22 "name" : " mp-oi-library" ,
33 "displayName" : " mp-oi-library" ,
44 "description" : " Some algorithms and data structures template for competitive programming." ,
5- "version" : " 0.2.1 " ,
5+ "version" : " 0.2.2 " ,
66 "repository" : " https://github.com/Mr-Python-in-China/mp-oi-library" ,
77 "license" : " LGPL-3.0-only" ,
88 "author" : {
You can’t perform that action at this time.
0 commit comments