70 WA 求 hack
查看原帖
70 WA 求 hack
857323
linxuanrui楼主2023/7/22 18:25

rt

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
ll n,m,a[100001];
vector<ll> v;
bool cmp(ll x,ll y){
	if(a[x] != a[y])return a[x] < a[y];
	else return x < y;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> m;
	for(ll i = 1;i <= n;i++)cin >> a[i],v.push_back(i);
	sort(v.begin(),v.end(),cmp);
	for(ll i = 0;i < v.size();i++)cout << v[i] << " ";
} 
2023/7/22 18:25
加载中...