From b4dfef229d9c992cb64912056c4102a566868c3d Mon Sep 17 00:00:00 2001 From: Kamlesh Bisht <75537446+kamlesh012@users.noreply.github.com> Date: Fri, 23 Jul 2021 23:19:42 +0530 Subject: [PATCH] STL ->Save Time Important Standard Template Library Functions to Save Time during Contests in CP --- STL | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 STL diff --git a/STL b/STL new file mode 100644 index 0000000..a214d90 --- /dev/null +++ b/STL @@ -0,0 +1,28 @@ +//Part of #include +Important STL Functions to save Time + +1->max({a, b, c, d}); ->Max of multiple elements +2->max_element(start, end) ->max in range +3->count(begin, end) ->just as name +4->accumulate(begin, end) ->sum of elements in range + +5->merge(range1 begin , range1 end, range2 begin, range2 end) ->merge two sorted ranges. + +6->unique(.begin(), .end()) ->removes consecutive duplicates only. +*Does not change container size.Just returns iterator to the new size. + +Read more at cpluscplus.com + + Containers-> + + map + unordered_map + + multimap + unordered_multimap + + set + multiset + + unordered_set + unordered_multiset