Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
335626 | 钟宜辰 | 【C5-9】插入排序 | C++ | 通过 | 100 | 91 MS | 268 KB | 478 | 2025-07-23 15:47:05 |
#include<bits/stdc++.h> using namespace std; struct s{ int a,b,c; }cnt[1500]; bool cmp(s x,s y){ if(x.a!=y.a){ return x.a>y.a; } if(x.a==y.a&&x.b!=y.b){ return x.b<y.b; } if(x.b==y.b&&x.a==y.a&&x.c!=y.c){ return x.c<y.c; } } int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>cnt[i].a>>cnt[i].b>>cnt[i].c; } sort(cnt+1,cnt+n+1,cmp); for(int j=1;j<=n;j++){ cout<<cnt[j].a<<" "<<cnt[j].b<<" "<<cnt[j].c<<endl; } return 0; }