Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
321362 陈信宇 【C5-9】表演 C++ 通过 100 1 MS 260 KB 392 2025-05-10 13:22:05

Tests(10/10):


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


测评信息: