
STL-排序
zafkiel_nightmare
弱弱的程序员
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 1236 排序
自定义排序,大水题#include#include using namespace std;struct stu{ string name; int score;};bool cmp(stu x,stu y){ if(x.score==y.score) return x.name<y.name; return x.score>y.score;}int main(){原创 2015-03-19 19:29:13 · 412 阅读 · 0 评论 -
hdu 1872 稳定排序
简单的自定义排序#include#include#define maxn 300+5using namespace std;struct stu{ string name; int score; int lev;};bool cmp(stu x,stu y){ if(x.score==y.score) return x.lev<y.lev; return x.scor原创 2015-04-25 20:14:09 · 471 阅读 · 0 评论 -
hdu 5162 Jump and Jump...
按顺序输出每个人跳远距离的排名.数据结构自定义排序,输出有点麻烦#include#includeusing namespace std;struct stu{ int number; int max; int lv;};bool cmp(stu x,stu y){ return x.max>y.max;}int main(){ int t; cin>>t;原创 2015-02-11 13:46:36 · 560 阅读 · 0 评论 -
hdu 1862 EXCEL排序
自定义排序,很简单的啦.#include#includeusing namespace std;struct stu{ string num; string name; int sc;};bool cmp1(stu x,stu y){ return x.num<y.num;}bool cmp2(stu x,stu y){ if(x.name==y.name){re原创 2015-02-02 23:37:25 · 340 阅读 · 0 评论 -
hdu 5182 PM2.5
自定义排序,无压力#include#include#define maxn 100+5using namespace std;struct stu{ int id,a,b,c;};stu mapp[maxn];bool cmp(stu x,stu y){ if(x.c==y.c) { if(x.b==y.b) return x.id<y.id; return x原创 2015-07-06 02:04:28 · 663 阅读 · 0 评论