Ankit_132

Airport Management

Jul 12th, 2023
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1.  
  2. #include <bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. #define ll     long long
  7. #define _test   int _TEST; cin>>_TEST; while(_TEST--)
  8.  
  9. int main()
  10. {
  11.     _test
  12.     {
  13.         int n;
  14.         cin>>n;
  15.  
  16.         map<int, int> cnt;
  17.  
  18.         vector<int> a(n), b(n);
  19.         for(auto &e: a)     cin>>e;
  20.         for(auto &e: b)     cin>>e;
  21.  
  22.         for(auto e: a)      cnt[e]++;
  23.         for(auto e: b)      cnt[e]++;
  24.  
  25.         int ans = 0;
  26.  
  27.         for(auto [x, y]: cnt)
  28.             ans = max(ans, y);
  29.  
  30.         cout<<ans<<"\n";
  31.     }
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment