- 注意添加头文件#include
要用到sort,注意采用#include - 对一个pair < int,int>的vector排序
auto cmp=[](const pair < int,int>&a,const pair < int,int> &b )
{ return (a.first>b.first)||((a.first==b.first) &&(a.second < b.second));};
sort(people.begin(),people.end(),cmp);
刷题总结#1
最新推荐文章于 2024-04-03 16:41:36 发布