Precreation contest files
This commit is contained in:
25
misc/tlbdhsg/b19.cpp
Normal file
25
misc/tlbdhsg/b19.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int n;
|
||||
cin >> n;
|
||||
unordered_set<int> hash;
|
||||
deque<int> res;
|
||||
|
||||
while (n--) {
|
||||
int x;
|
||||
cin >> x;
|
||||
if (hash.find(x) == hash.end()) {
|
||||
res.push_back(x);
|
||||
hash.insert(x);
|
||||
}
|
||||
}
|
||||
cout << res.size() << '\n';
|
||||
while (!res.empty()) {
|
||||
cout << res.front() << " ";
|
||||
res.pop_front();
|
||||
}
|
||||
cout << '\n';
|
||||
}
|
||||
Reference in New Issue
Block a user