Advertisement
momo2345

twice counter

Jul 29th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1. // ********* Assalamualaikum****** IN the name of my Almighty****:):)***
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. #define suni ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
  5. #define endl "\n"
  6. #define f(i,a,b) for(int i=a;i< b;i++)
  7. #define ff(i,a,b) for(int i= a;i>=b;i--)
  8. #define T int t; cin >>t; while(t--)
  9. #define vi  vector<int>
  10. #define vll vector<long long>
  11. #define vs vector<string>
  12. #define vp vector<pair
  13. #define pii pair<int,int>
  14. #define pb push_back
  15. #define mk make_pair
  16. #define b(a) a.begin(),a.end()
  17. #define rb(a) a.rbegin(),a.rend()
  18. #define I  int
  19. #define ll long long
  20. #define st string
  21. #define MN int main()
  22. MN{
  23.     T{
  24.         suni;
  25.         I n;
  26.         cin>>n;
  27.         map<st,I> m;
  28.         f(i,0,n) {
  29.             st s;
  30.             cin>>s;
  31.             m[s]++;
  32.         }
  33.         I cnt=0;
  34.         for(auto u : m){
  35.             if(u.second==2) cnt++;
  36.         }
  37.         cout<<cnt<<endl;
  38.     }
  39. }
  40.  
  41. //*******Happy Coding*******???******
  42.  
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement