玄学的洛谷(违规自叁
  • 板块题目总版
  • 楼主zhuoheng
  • 当前回复8
  • 已保存回复8
  • 发布时间2023/10/28 08:54
  • 上次更新2023/11/2 11:08:24
查看原帖
玄学的洛谷(违规自叁
1023698
zhuoheng楼主2023/10/28 08:54
#include<bits\stdc++.h>
using namespace std;
struct node{
	int v,id;
}z[50001];
bool cmp(node a,node b){
	return a.v<b.v;
}
bool cmp2(node a,node b){
	return a.id<b.id;
}
int t,n;
int main(){
	cin>>t;
	while(t--){
		cin>>n;
		for(int i=1;i<=n;i++)cin>>z[i].v,z[i].id=i;
		sort(z+1,z+n+1,cmp);
		unique(z+1,z+n+1,cmp);
		sort(z+1,z+n+1,cmp2);
		for(int i=1;i<=n;i++)cout<<z[i].v<<" ";
		cout<<"\n";
	}
}

本地可编译,锣鼓直接CE; 求问:为啥?

2023/10/28 08:54
加载中...