#include using namespace std; //map排序(key)的比较器 struct cmpFunction { bool operator()(const int &k1, const int &k2) const { return k1 < k2; } }; int main() { int n; cin >> n; map _map; for (int i = 0; i < n; ++i) { int c; cin >> c; _map[c]++; } //输出结果 cout << _map.size() << endl; for (map::iterator iter = _map.begin(); iter != _map.end(); ++iter) { cout << iter->first << " "; } return 0; }