样例过了,落谷爆0
查看原帖
样例过了,落谷爆0
332399
TeaWine楼主2020/11/26 17:36
#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	
	int n, m[1010];
	
	bool m1[1010];
	
	cin>>n;
	
	for(int i = 0; i<n; i++) cin>>m[i];
	
	for(int i = 0; i<n; i++) m1[i]=1;
	
	sort(m,m+n);
	
	for(int i = 0; i<n; i++)
	for(int o = 0; o<n; o++)
	if(m[i]==m[o]) {n--; m1[i]=0;}
	
	cout<<n<<endl;
	
	for(int i = 0; i<n; i++)
	if(m1[i])cout << m[i] << " ";
	
	return 0;
}
2020/11/26 17:36
加载中...