Advertisement
AmidamaruZXC

Untitled

Nov 19th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <set>
  2. #include <unordered_set>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     int n;
  9.     string word;
  10.     cin >> n;
  11.     set<string> words;
  12.     unordered_set<string> res;
  13.     for (int i = 0; i < n; i++)
  14.     {
  15.         cin >> word;
  16.         if (words.find(word) == words.end())
  17.             words.insert(word);
  18.         else
  19.             res.insert(word);
  20.     }
  21.     if (res.size() != 0)
  22.         for (auto i : res)
  23.             cout << i << endl;
  24.     else
  25.         cout << "Understandable, have a great day" << endl;
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement