pair<int, int> set<pair<int, int>>
来源:互联网 发布:互助盘软件开发 编辑:程序博客网 时间:2024/04/29 03:39
///pair也是
///set默认的比较规则先按照first比较,如果first相同,再按照second 比较。
///注意:定义的时候右边的两个>>要空一格。set<pii> s;
int main()
{
set<pii>::iterator it;
s.insert(make_pair(1,3));
s.insert(make_pair(1,2));
s.insert(make_pair(2,0));
s.insert(make_pair(2,1));
s.insert(make_pair(2,-10));
for(it=s.begin();it!=s.end();it++)
{
printf("%d %d\n",it->first,it->second);
}
pii p=make_pair(1,3);
it=s.upper_bound(p);
if(it!=s.end())printf("恰好大于(1,3)的是(%d %d)\n",it->first,it->second);
return 0;
}
0 0
- pair<int, int> set<pair<int, int>>
- set<pair<int,int> >的用法
- set<pair<int,int> >的用法
- [C++]pair<int,int>与make_pair<int,int>
- map<pair,int>嵌套类型
- UESTC 1603 BanG Dreamer 小根堆、贪心+set<pair<int, int>>+low_bound
- 判断平行四边形数(typedef pair<int,int> p;)
- Triangles HUST 1607 (map<pair,int>,几何)
- Instability(typedef pair<LL,int> P;)
- set<int,greater<int>>
- int
- int?
- int ?
- int
- Int
- int?
- gym/101149/ Of Zorcs and Axes set<pair<int, int > > it->second; it = s.lower_bound( make_pair(u[
- int*&、int&*
- lambda表达式的实质
- 使用jquery.qrcode生成二维码
- LeetCode(38)-Valid Sudoku
- 双向链表的实现
- Android 学习记录-网络请求
- pair<int, int> set<pair<int, int>>
- 有关angular的compile与apply的使用小记
- 添加sqljdbc的maven依赖
- CodeForces 18 B Platforms
- 微软2016校园招聘4月在线笔试题
- TCP状态转移图和四次握手
- 【Objective-C】GCD介绍
- hdu4975(二分图)
- 中国农业银行2015年10月利息计算程序