提交时间:2025-05-04 10:48:41
运行 ID: 320317
#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; }