Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
320317 | 陈信宇 | 【C5-9】归并排序 | C++ | 通过 | 100 | 14 MS | 260 KB | 496 | 2025-05-04 10:48:41 |
#include<bits/stdc++.h> using namespace std; struct pe{ int h; int s; int id; }a[10086]; bool cmp(pe x,pe y){ if(x.h!=y.h) return x.h>y.h; if(x.h==y.h&&x.s!=y.s) return x.s<y.s; if(x.h==y.h&&x.s==y.s&&x.id!=y.id) return x.id<y.id; } int main(){ int n,m; cin>>n>>m; for(int i=1;i<=n+m;i++){ cin>>a[i].h>>a[i].s>>a[i].id; } sort(a+1,a+n+m+1,cmp) ; for(int i=1;i<=n+m;i++){ cout<<a[i].h<<" "<<a[i].s<<" "<<a[i].id<<endl; } return 0; }