Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
321427 李韩韬 【C5-9】病人排队 C++ 解答错误 0 10 MS 260 KB 497 2025-05-10 13:47:25

Tests(0/10):


#include <bits/stdc++.h> using namespace std; struct hsg{ string id; int age,t; }p[108]; bool cmp(hsg x,hsg y){ if(x.age>=60 && y.age>=60){ if(x.age != y.age)return x.age > y.age; return x.t > y.t; } if(x.age<60 && y.age<60) return x.t<y.t; return x.age >y.age; } int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>p[i].id>>p[i].age; p[i].t=i; } sort(p+1,p+n+1,cmp); for(int i=1;i<=n;i++){ cout<<p[i].id<<endl; } return 0; }


测评信息: