atoi
字符串转int
char a[N];
cin >> a;
int b = atoi(char a);
push_heap()
建堆,默认原数组已经是个堆,再插入一个元素
int a[N];
for (int i = 1; i <= n; i ++ )
{
scanf("%d", &h[i]);
push_heap(h + 1, h + i + 1, greater<int>()); //小根堆
push_heap(h + 1, h + i + 1, less<int>()); //大根堆
}
make_heap()
建堆,将整个数组调整为一个堆
vector<int> q; //
for (int i = 0; i < 10; i++) {
q.push_back(i);
}
make_heap(q.begin(), q.end(),less<int>());
其他heap函数:
https://www.cnblogs.com/woxiaosade/p/10628388.html