Advertisement
Asif_Anwar

Timus-1496. Spammer

Apr 8th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. #define pb push_back
  5. #define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  6. #define F first
  7. #define S second
  8. typedef long long ll;
  9. typedef vector< int > vi;
  10. typedef vector< ll > V;
  11. typedef map<int, int > mp;
  12. #define debug cout << -1 << endl;
  13. #define REP(i, a, b) for(int i=a; i<b; i++)
  14. #define pop pop_back
  15. const ll MOD = 1000000007;
  16. const int maxN = 2001;
  17.  
  18. int dx[] = {-1, 0, 1, -1, 1, -1, 0, 1};
  19. int dy[] = {-1, -1, -1, 0, 0, 1, 1, 1};
  20.  
  21. void solve()
  22. {
  23.     int n;
  24.     cin >> n;
  25.     cin.ignore();
  26.     map< string, int > m;
  27.     while(n--) {
  28.         string str;
  29.         cin >> str;
  30.         if(m[str]==1) cout << str << "\n";
  31.         m[str]++;
  32.     }
  33.     return;
  34. }
  35.  
  36. int main()
  37. {
  38.     FastIO;
  39.     int t;
  40.     t = 1;
  41.     //cin >> t;
  42.     while(t--){
  43.         solve();
  44.     }
  45.     return 0;
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement