STL之set/multiset

# 概念

        set和multiset是基于红黑树实现的集合类,set不允许有重复元素,multiset允许有重复元素。使用前需加入头文件# include<set>。

# 常用函数

  • 创建集合
    multiset<int>res;
  • 降序排列
    multiset<int,greater<int> > res;
    

      

猜你喜欢

转载自www.cnblogs.com/wanglei5205/p/9176631.html