开始 2024-08-19 00:00:00

8.19-8.24集训第一天

结束 2024-08-25 23:59:00
Contest is over.
当前 2024-12-22 14:09:07

H

include<bits/stdc++.h>

using namespace std; struct H{

int a,b;

}a[100005]; bool cmp(H x,H y){

if(x.a==y.a){
	return x.b<y.b;
}else{
	return x.a<y.a;
}

} int main(){

int n;
cin>>n;
for(int i=1;i<=n;i++){
	cin>>a[i].a>>a[i].b;
}
sort(a+1,a+1+n,cmp);
for(int i=1;i<=n;i++){
	cout<<a[i].a<<" "<<a[i].b<<"\n";
}
return 0;

}


lukaiming  •  4个月前
#include<bits/stdc++.h>
using namespace std; struct H{

int a,b;
}a[100005]; bool cmp(H x,H y){

if(x.a==y.a){
	return x.b<y.b;
}else{
	return x.a<y.a;
}
} int main(){

int n;
cin>>n;
for(int i=1;i<=n;i++){
	cin>>a[i].a>>a[i].b;
}
sort(a+1,a+1+n,cmp);
for(int i=1;i<=n;i++){
	cout<<a[i].a<<" "<<a[i].b<<"\n";
}
return 0;
}

lukaiming  •  4个月前

比赛已结束。