STL
槿年如梦
学生,不定期更新
展开
-
优先队列+pair
代码#include<cstdio>#include<queue>#include<iostream>using namespace std;typedef pair<int,int> prefix;struct cmp{ bool operator()(const prefix p1,const prefix p2) { r...原创 2019-11-09 20:58:53 · 1919 阅读 · 0 评论 -
使用vector对数据进行排序(动态排序)
排序思路头函数 algorithm 中有一个函数是 upper_bound(start,end,value) 它可以返回区间 [start,end] 中第一个大于等于 value 的值的位置 再加上 vector 中自带的插入函数 insert(space,value) 就可以对数据进行类似于二分排序的排序 时间复杂度(预期):n * logn * logn 代码如下#incl...原创 2019-10-23 18:45:11 · 3357 阅读 · 0 评论 -
STL之map函数---逆序删除
map的逆向删除#include<cstdio>#include<iostream>#include<cstring>#include<map>using namespace std;int n;map<int,char> asd;typedef map<int,char>::iterator prefix;...原创 2019-06-27 21:58:52 · 766 阅读 · 0 评论