Some short snippets that will shorten your time.

Revision en2, by thanhchauns2, 2022-07-27 05:14:17

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 them (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://codeforces.com/blog/entry/11080

Thanks for reading! Hope this can help you.

A little surprise

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English thanhchauns2 2022-07-27 05:14:17 11 Tiny change: 'et rid of it (or just ' -> 'et rid of them (or just '
en1 English thanhchauns2 2022-07-27 05:13:21 4573 Initial revision (published)