C++ Standards
The first thing to introduce is the versions of C++ itself. Since C++ is only a language and different compilers implement C++ in different ways, standardization is needed to constrain compiler implementations so that C++ code behaves consistently across different compilers. Since C++ was created in 1985, the International Organization for Standardization (ISO) has released seven official C++ standards: 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), and C++23 (also known as C++2b). C++ standard drafts are available on the open-std website, and the development status of the latest standard can be viewed at Current Status : Standard C++. There are also some supplementary standards, such as C++ TR1.
Each version of the C++ standard not only specifies C++ syntax and language features, but also specifies implementation requirements for a set of C++ built-in libraries; this set of libraries is the C++ Standard Library. The C++ Standard Library contains implementations of a large amount of commonly used code, such as input and output, basic data structures, memory management, and multithreading support. Mastering the C++ Standard Library is a necessary step toward writing more modern C++ code. Detailed documentation for the C++ Standard Library is available on cppreference. The documentation introduces the usage, efficiency, and caveats of types and functions in the standard library; please make good use of it.
It should be noted that different OJ platforms support different C++ versions. For example, the latest ICPC contest rules support the C++20 standard. According to a resolution of the NOI Scientific Committee, from September 1, 2021, NOI Linux 2.0 has been used as the standard environment for the NOI series of contests and CSP-J/S and other activities. The g++ 9.3.0 specified in NOI Linux 2.0 supports by default the C++14 standard and also supports C++17, which meets the needs of the vast majority of contestants. Therefore, when learning C++, pay attention to the standard supported by the contest to avoid compilation errors at the contest site.
Standard Template Library (STL)
STL, or the Standard Template Library, is part of the C++ Standard Library and contains some templated general-purpose data structures and algorithms. Because it is templated, it can work with custom data types and avoids a great deal of reinventing the wheel. Both NOI and ICPC contests support the use of the STL library, so making reasonable use of STL can avoid writing unnecessary algorithms and fully exploit compiler optimizations for template libraries to improve efficiency. For a detailed introduction to the STL library, see the corresponding pages: STL Containers and STL Algorithms.
What Does Reinventing the Wheel Mean
Reinventing the wheel (Reinventing_the_wheel) refers to repeatedly inventing algorithms that already exist or repeatedly writing code that has already been optimized. Reinventing the wheel is usually time-consuming and laborious, while the result is still not as good as someone else's. However, reinventing the wheel is necessary for learning or practice.
Boost Library
Boost is another renowned open-source C++ library of tools besides the standard library. Its code is portable, high-quality, high-performance, and highly reliable. Boost contains a very large number of modules, has comprehensive functionality, and provides complete cross-platform support, so it is regarded as the quasi-standard library for C++. Many features in the C++ standard also originated from Boost, such as smart pointers, metaprogramming, and date and time. Although Boost cannot be used in OI, many components in Boost can be used to verify algorithms or perform differential testing. For example, Boost.Geometry implements R-trees, Boost.Graph provides graph-related algorithms, and Boost.Intrusive provides intrusive containers whose usage is similar to that of STL containers. Interested readers can search for tutorials online.