提交时间:2023-11-23 13:26:37

运行 ID: 111677

#include<bits/stdc++.h> using namespace std; struct gg{ int id,z; bool operator < (const gg &o)const{ if(z!=o.z) return z<o.z; else return id<o.id; } }; gg a[10005]; int main(){ int n,l=0,p=0; bool c=1; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i].z; a[i].id=i; } sort(a+1,a+n+1); return 0; }