Advertisement
kadeyrov

Untitled

Sep 10th, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <algorithm>
  4. #include <vector>
  5. #include <string>
  6. #include <set>
  7. #include <map>
  8.  
  9. using namespace std;
  10.  
  11. int main () {
  12.     map <string, int> f1, f2;
  13.    
  14.     int n;
  15.     cin >> n;
  16.    
  17.     for (int i = 0; i < n; i++) {
  18.         string s;
  19.         cin >> s;
  20.        
  21.         f1[s]++;
  22.     }
  23.    
  24.     for (int i = 0; i < n; i++) {
  25.         string s;
  26.         cin >> s;
  27.        
  28.         f2[s]++;
  29.     }
  30.    
  31.     long long ans = n;
  32.    
  33.     for (auto it : f1) {
  34.         ans -= min (it.second, f2[it.first]);
  35.     }
  36.     cout << ans << endl;
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement