Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
321363 王栎州 【C5-9】表演 C++ 编译错误 0 0 MS 0 KB 399 2025-05-10 13:22:12

Tests(0/0):


#include<bits/stdc++.h> using namespace std; struct hsq{ int a,id; }a[10086]; bool cmp(hsq x,hsq y){ if(x.age!=y.age){ return x.age>y.age; } return x.id<y.id; } int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i].a; a[i].id=i; } sort(a+1,a+n+1,cmp); for(int i=1;i<=n;i++){ cout<<a[i].a<<" "; cout<<a[i].id<<" "; } return 0; }


测评信息: