Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
134774 沈梓珺 双关键字排序 C++ 解答错误 80 41 MS 332 KB 417 2024-03-02 17:33:18

Tests(4/5):


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


测评信息: