STL 总结

//想不到吧,这个代码真的能过编译。
//所以要是有什么问题,为什么不跑下看看呢
#include<bits/stdc++.h> using namespace std; int x; string str; bitset<30> mbs(100); ///重载运算符 struct node { int a,b; bool operator <(const node &x)const { return b>x.b; } }; ///自定义比较函数 struct cmp { bool operator ()(const int &a,const int &b) { return a>b; } }; ///vector vector<int> vec; ///stack stack<int> sta; ///queue queue<int> que; ///priority_queue priority_queue<int> q; priority_queue<int, vector<int> ,greater<int> > q1; priority_queue<node> q2; priority_queue<int, vector<int> ,cmp> q3; ///map map<int ,int> mp; map<string ,int> mp1; ///set & multi_set set<int> st; set<string> st1; set<bitset<30> > st2; set<node> st3; multiset<int> mst; ///bitset bitset<30> bs; bitset<30> bs1(111000); bitset<30> bs2=114514; int main() { ///vector vec.push_back(x); vec.size(); vec.begin(); vec.end(); vec.clear(); vec.erase(vec.begin()); for(int i=0;i!=vec.size();i++); for(vector<int>::iterator i=vec.begin();i!=vec.end();i++); ///priority_queue q.push(x); q.top(); q.pop(); q.empty(); q.size(); ///stack sta.push(x); sta.pop(); sta.top(); ///queue que.push(x); que.front(); que.pop(); ///priority_queue q.push(x); q2.push((node){x,x}); q.top(); q.pop(); ///map mp[x]=x; mp1[str]=x; ///set & multiset st.insert(x); st.erase(x); st.count(x);///返回0或1 mst.count(x);///返回x的数量 st.erase(x); mst.erase(x); ///bitset mbs=bs1|bs;///& ^ | mbs<<1; mbs>>1; mbs[x]=1; return 0; }

 

posted @ 2021-11-29 13:52  T_X蒻  阅读(28)  评论(0编辑  收藏  举报