C++ (For competitive programming)

The first thing that needs to be introduced is the version of C++ itself. Since C++ itself is just a language, and different compilers implement C++ in different ways, standardization is needed to constrain the implementation of compilers so that C++ code behaves consistently under different compilers. Since the birth of C++ in 1985, a total of 5 official C++ standards have been released by the International Organization for Standardization (ISO), namely C++98, C++03, C++11 (also known as C++0x), C ++14 (also known as C++1y), C++17 (also known as C++1z), C++20 (also known as C++2a). The C++ standard draft is on the open-std website, and the latest standard, C++23 (also known as C++2b), is still under development. There are also complementary standards such as C++ TR1.

Each version of the C++ standard not only stipulates the syntax and language features of C++, but also stipulates a set of implementation specifications for the C++ built-in library. This library is the C++ standard library. The C++ standard library contains the implementation of a large number of commonly used codes, such as input and output, basic data structures, memory management, multi-thread support, etc. Mastering the C++ standard library is an essential step toward writing more modern C++ code. The detailed documentation of the C++ standard library is on the cppreference website. The document introduces the usage, efficiency, precautions, etc. of the type functions in the standard library. Please make use of it.

It should be pointed out that different OJ platforms have different C++ versions. For example, the latest ICPC competition rules support the C++17 standard. In accordance with the NOI Scientific Committee resolution, starting September 1, 2021, NOI Linux 2.0 will be used as the standard environment for events such as the NOI competition series and CSP-J/S. The default support standard for g++ 9.3.0 specified in NOI Linux 2.0 is C++14 and supports the C++17 standard, which can meet the needs of most contestants. Therefore, when learning C++, you should pay attention to the standards supported by the competition to avoid compilation errors during the competition.