-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Important Standard Template Library Functions to Save Time during Contests in CP
- Loading branch information
1 parent
06c7fb9
commit b4dfef2
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//Part of #include <algorithm> | ||
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 |