1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
| vector
vector<int> a(10,1); vector<int> a; a.size() a.empty() a.clear() a.front()/back() a.push_back()/pop_back() begin()/end() [] for(int i=0;i<10;i++)a.push_back(i);
for(int i=0;i<a.size();i++)cout<<a[i]<<" "; for(auto i=a.begin();i!=a.end();i++)cout<<*i<<" "; for(auto x:a)cout<<x;
lower_bound (起始地址,结束地址,要查找的数值) upper_bound (起始地址,结束地址,要查找的数值) binary_search (起始地址,结束地址,要查找的数值)
pair<int, int> p; first second p=make_pair(1,10); p={1,10}; pair<int,pair<int,int>>
string size()/length() empty() clear() substr(起始下标,(子串长度)) c_str()
queue size() empty() push() front() back() pop()
priority_queue size() empty() push() top() pop()
stack size() empty() push() 向栈顶插入一个元素 top() 返回栈顶元素 pop() 弹出栈顶元素
deque size() empty() clear() front()/back() push_back()/pop_back() push_front()/pop_front() begin()/end() []
set, map, multiset, multimap
size() empty() clear() begin()/end() ++, -- set/multiset: insert(); find(); count(); erase(); map/multimap: insert(); erase(); []
unordered_set, unordered_map, unordered_multiset, unordered_multimap
bitset bitset<10000> s; ~, &, |, ^ >>, << ==, != []
count()
any() none()
set() set(k, v) reset() flip() flip(k)
|