Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
134263 | 唐钧 | 双关键字排序 | C++ | 通过 | 100 | 410 MS | 1028 KB | 436 | 2024-03-02 15:18:22 |
#include<bits/stdc++.h> using namespace std; struct fly { int a,b; }f[10000009]; bool cmp(fly x,fly y) { if(x.a==y.a)return x.b<y.b; else return x.a<y.a; } int main() { //freopen("power.in","r",stdin); //freopen("power.out","w",stdout); int t; cin>>t; for(int i=1;i<=t;i++) { cin>>f[i].a>>f[i].b; } sort(f+1,f+1+t,cmp); for(int i=1;i<=t;i++) { cout<<f[i].a<<' '<<f[i].b<<endl; } return 0; }