Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <set>
- #include <string>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- vector <string> v;
- set<string> s;
- for (int i = 0; i < n; ++i) {
- string str;
- getline(cin, str);
- if (!s.count(str)) {
- v.push_back(str);
- s.insert(str);
- }
- }
- for (const auto& elem : v) {
- cout << elem << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement