主要bb一下优先队列和字符串吧. 哦还有 bitset.
priority_queue<int> pq;pq.top() 取堆顶元素; (没有 front() 方法!)pq.push(x) 插入;pq.pop() 删除(删除堆顶);pq.empty() 判断是否为空.priority_queue<int> pq;priority_queue< int, vector<int>, greater<int> > pq;cmp 的方法(优先级最大的最先出队): | 1 | struct | 
定义更容易: string s;
s.size() 串长度(下标从0 开始);s.substr(a, n) 构造子串, a为第一个字符的下标, n为子串字符长度;s'find(it1, it2, x) 在指针 it1 和 it2 中间查找字符 x; (s.find(x) 为整个 s 中查找 x)s.erase(a) 删除元素, a貌似是指针, 可以和 find 合用去除指定字符, 如 s.erase(std::find(s.begin(), s.end(), ' ')); 去掉所有空格;s.empty() 判断是否为空;push_back 和 pop_back;+, = 和 == 运算.auto it = s.begin(); it != s.end(); it++ 遍历;int i = 0; i < s.size(); i++ 遍历.stoi, stol, stoll: 字符串转整数;stof, stod, stold: 字符串转浮点数;to_string 直接转成 std::string.定义: bitset<length> b(value);
&, ^, <<, >>等;to_string() 转化为字符串;to_ulong(), to_ullong() 转化为无符号整数;flip(i) 第i位取反, 下标从0开始. flip() 全部按位取反.原文:https://www.cnblogs.com/lijianming180/p/12147623.html