Introduction to pb_ds
The pb_ds library stands for Policy-Based Data Structures.
The pb_ds library encapsulates many data structures, such as hash tables, balanced binary trees, Trie trees, heaps (priority queues), etc.
Just like vector, set, and map, its components all conform to the relevant interface specifications of the STL. Some components (such as priority queues) include all the functionalities of their corresponding STL components, but offer more features than the STL.
pb_ds can only be used with compilers that use libstdc++ as the standard library.
You can use begin() and end() to obtain an iterator for traversal.
You can perform increase_key, decrease_key, and delete individual elements.
Since the main content of the pb_ds library resides in the __gnu_pbds namespace, which starts with an underscore, its compliance in NOI series events has long been uncertain. On September 1, 2021, according to the 《Supplementary Explanation on Programming Language Usage Restrictions in NOI Series Events》, the use of library functions or macros starting with an underscore is permitted (except for those explicitly prohibited). This provides a documented basis for the compliance of using the pb_ds library in NOI series events.
Reference: 《Applications of C++'s pb_ds Library in OI》
本页面最近更新:,更新历史
发现错误?想一起完善? 在 GitHub 上编辑此页!
本页面贡献者:OI-wiki
本页面的全部内容在 CC BY-SA 4.0 和 SATA 协议之条款下提供,附加条款亦可能应用