1.常用函数
next_premutation(a,a+n) //全排列
unique(a,a+n) // 去重搭配sort使用
string //
string s;
s.pop_back() // 弹出字符串尾部
s.back(); // 返回字符串最后一位字符
string s=to_string(int) // 把数字变成string
s.c_str() //把s变成char指针类型 作用于atoi函数的参数
int num = atoi(string.c_str()) // 把string变成数字
revserse(s.begin(),s.end()); //翻转字符串
getline(cin,string)
getline //之前要是有输入函数 需要先把空格读出来
2.STL
#include<queue>
priority_queue<int>与queue不同的就在于我们可以自定义其中数据的优先级, 让优先级高的排在队列前面,优先出队
top 访问队头元素
empty 队列是否为空
size 返回队列内元素个数
push 插入元素到队尾 (并排序)
emplace 原地构造一个元素并插入队列
pop 弹出队头元素
swap 交换内容
支持自定义比较函数
priority_queue<int,vector<int>,greater<int> >