Hi there!
In this blog I would like to share some of the code snippets that can shorten your time in future contests. Of course, I'll ignore the "international snippets"
like:
Sometimes you may find typing the identical thing again and again is boring, this blog is about some method that a few people use to get rid of it (or just only me).
So, let's get started.
Scanning/printing the whole vector in a single std::cin/std::cout
Snippet
Usage
Scanning/printing std::pair
Snippet
Usage
Ordered set and ordered multiset
Snippet
Usage
Short declaration of 2D and 3D vectors
Snippet
Usage
Erase repeated neighbor elements
Snippet
Usage
Prime test for large numbers
Snippet
Longest Increasing Subsequence
Snippet
Longest Strictly Increasing Subsequence
Snippet
Some snippets are mine, some are taken from the internet. If you want to add some snippets on the blog, please let me know in the comment section.
You can read more about ordered_set and ordered_multiset here: https://mirror.codeforces.com/blog/entry/11080
Thanks for reading! Hope this can help you.
A little surprise