Ankit_132

Transfusion Chain

Jun 21st, 2023
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int t;
  6.     cin>>t;
  7.    
  8.     while(t--)
  9.     {
  10.         int n;
  11.         cin>>n;
  12.  
  13.         vector<string> v(n);
  14.         for(auto &e: v)     cin>>e;
  15.  
  16.         map<string, int> mp;
  17.         for(auto e: v)
  18.             mp[e]++;
  19.  
  20.         int ans = max(mp["O"]+mp["A"]+mp["AB"],
  21.                       mp["O"]+mp["B"]+mp["AB"]);
  22.  
  23.         cout<<ans<<"\n";
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment