双关键字set排序
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#include<set>
using namespace std;
#define INF 0x3f3f3f3f
int main()
{
set<pair<int,int> > s;
s.insert(make_pair(3,1));
s.insert(make_pair(3,2));
s.insert(make_pair(1,1));
s.insert(make_pair(1,2));
s.insert(make_pair(3,5));
s.insert(make_pair(2,4));
set<pair<int ,int> > ::iterator it;
for(it=s.begin();it!=s.end();it++)
cout<<it->first<<' '<<it->second<<"\n";
it=s.upper_bound(make_pair(2,4));
if(it!=s.end())
printf("(2,4)后面接着是%d %d\n",it->first,it->second);
}
标签:std,insert,set,make,pair,include
From: https://www.cnblogs.com/caterpillor/p/17386389.html