Derga

Untitled

Jul 30th, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <set>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     int n;
  9.     cin >> n;
  10.     vector <string> v;
  11.     set<string> s;
  12.  
  13.     for (int i = 0; i < n; ++i) {
  14.         string str;
  15.         cin >> str;
  16.         if (!s.count(str)) {
  17.             v.push_back(str);
  18.             s.insert(str);
  19.         }
  20.     }
  21.  
  22.     for (const auto& elem : v) {
  23.         cout << elem << endl;
  24.     }
  25.  
  26.     return 0;
  27. }
  28.  
Add Comment
Please, Sign In to add comment