#include <unordered_set>
http://c.biancheng.net/view/7250.html
set 容器内的元素会被自动排序,set 与 map 不同,set 中的元素即是键值又是实值,set 不允许两个元素有相同的键值。
#include <set>
定义及初始化
set<int> a;
1 容量函数
容器大小:st.size();
容器判空:st.empty();
查找键 key 的元素个数:st.count(key);
2 添加函数
在容器中插入元素:st.insert(const T& x);
任意位置插入一个元素:st.insert(iterator it, const T& x);
3 删除函数
删除容器中值为 elem 的元素:st.pop_back(const T& elem);
删除it迭代器所指的元素:st.erase(iterator it);
清空所有元素:st.clear();
4 访问函数
st.find(key);
查找键 key 是否存在,若存在,返回该键的元素的迭代器;若不存在,返回set.end()
https://www.cnblogs.com/linuxandmcu/p/10261014.html