用了许多库函数
sort(): 排序vector数组
erase(): 分别除掉a,b两个数组中重复的值
insert(): 合并a,b两个数组
#include <iostream>
#include <cctype>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 10010;
int n,m;
vector<string> a,b;
int main()
{
cin>>n>>m;
string s;
//输入并转换为小写
for(int i=0; i<n; i++)
{
cin>>s;
for(int j=0; j<s.length(); j++)
if(isupper(s[j])) s[j]+=32;
a.push_back(s);
}
for(int i=0; i<m; i++)
{
cin>>s;
for(int j=0; j<s.length(); j++)
if(isupper(s[j])) s[j]+=32;
b.push_back(s);
}
sort(a.begin(), a.end()), sort(b.begin(), b.end());
a.erase(unique(a.begin(), a.end()), a.end());
b.erase(unique(b.begin(), b.end()), b.end());
a.insert(a.end(), b.begin(), b.end());
sort(a.begin(), a.end());
//并集个数
int num = unique(a.begin(), a.end())-a.begin();
cout<<a.size()-num<<"\n"<<num;
return 0;
}