题目
代码
cpp
#include <bits/stdc++.h>
using namespace std;
unordered_set<string> s1, s2;
int cnt1, cnt2, cnt;
int n, m;
void process(string& x)
{
for(char& c : x)
{
if(c >= 'a') continue;
else c += 'a' - 'A';
}
}
int main()
{
cin >> n >> m;
for(int i = 1; i <= n; i++)
{
string x;
cin >> x;
process(x);
s1.insert(x);
}
for(int i = 1; i <= m; i++)
{
string x;
cin >> x;
process(x);
s2.insert(x);
}
cnt1 = s1.size(), cnt2 = s2.size();
for(auto c : s1)
{
if(s2.find(c) != s2.end()) cnt++;
}
cout << cnt << endl << cnt1 + cnt2 - cnt << endl;
return 0;
}