Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
13278 陈颖钧 坐标排序 C++ 解答错误 0 2 MS 256 KB 543 2025-09-14 17:48:29

Tests(0/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.x){ 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; }


测评信息: