Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
13290 陈颖钧 坐标排序 C++ 通过 100 2 MS 256 KB 543 2025-09-17 21:52:35

Tests(2/2):


#include<bits/stdc++.h> using namespace std; long long n,i; struct date{ int x,y; }a[9999999]; bool cmp(date x,date y){ if(x.x<y.x){ return true; }else if(x.x==y.x){ if(x.y<y.y){ return true; }else{ return false; } }else{ return false; } } int main(){ cin>>n; for(i=1;i<=n;i++){ cin>>a[i].x>>a[i].y; } sort(a+1,a+n+1,cmp); for(i=1;i<=n;i++){ cout<<a[i].x<<' '<<a[i].y<<endl; } return 0; }


测评信息: