Run ID:61545
提交时间:2023-12-10 11:12:10
#include<bits/stdc++.h> using namespace std; int main(){ int n, tmp, m; cin >> n; m = 0; int t[100001] = {}; for(int i = 0; i < n; i++){ cin >> tmp; t[tmp]++; if(t[tmp] == 1){ m++; } } cout << m <<endl; for(int i = 0; i <= 100000; i++){ if(t[i] != 0){ cout << i <<" "; } // for(int j = 0; j < t[i]; j++){ // cout << i << " "; // } } return 0; }