版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weifuliu/article/details/81070274
#include<iostream>
#include<map>
#include<string>
#include<cmath>
using namespace std;
string a, b;
map<string, int> pre, cur;
int ans = 0;
void map_init() {
pre.insert(pair<string, int>("S", 0));
pre.insert(pair<string, int>("XS", 0));
pre.insert(pair<string, int>("XXS", 0));
pre.insert(pair<string, int>("XXXS", 0));
pre.insert(pair<string, int>("L", 0));
pre.insert(pair<string, int>("XL", 0));
pre.insert(pair<string, int>("XXL", 0));
pre.insert(pair<string, int>("XXXL", 0));
pre.insert(pair<string, int>("M", 0));
cur.insert(pair<string, int>("S", 0));
cur.insert(pair<string, int>("XS", 0));
cur.insert(pair<string, int>("XXS", 0));
cur.insert(pair<string, int>("XXXS", 0));
cur.insert(pair<string, int>("L", 0));
cur.insert(pair<string, int>("XL", 0));
cur.insert(pair<string, int>("XXL", 0));
cur.insert(pair<string, int>("XXXL", 0));
cur.insert(pair<string, int>("M", 0));
}
void display_map() {
map<string, int>::const_iterator map_it;
cout << "pre:" << endl;
for (map_it = pre.begin(); map_it != pre.end(); map_it++)
{
cout << "(\"" << map_it->first << "\"," << map_it->second << ")" << endl;
}
cout << "cur:" << endl;
for (map_it = cur.begin(); map_it != cur.end(); map_it++)
{
cout << "(\"" << map_it->first << "\"," << map_it->second << ")" << endl;
}
}
bool compare_map() {
map<string, int>::const_iterator map_it;
map<string, int>::const_iterator it;
it = cur.begin();
for (map_it = pre.begin(); map_it != pre.end(); map_it++) {
if (map_it->second != it->second) {
return false;
}
else
it++;
}
return true;
}
void solve() {
map<string, int>::const_iterator map_it;
map<string, int>::const_iterator it;
int c;
for (it = pre.begin(),map_it=cur.begin(); it != pre.end(),map_it!=cur.end(); it++,map_it++) {
c = it->second - map_it->second;
if (c > 0)
ans += c;
}
}
int main()
{
int n;
cin >> n;
int pre_cnt, cur_cnt;
map_init();
for (int i = 0; i < n; i++) {
cin >> a;
pre[a]++;
}
for (int i = 0; i < n; i++) {
cin >> b;
cur[b]++;
}
//display_map();
if (compare_map()) {
cout << "0" << endl;
//cout << "same" << endl;
}
else {
solve();
cout << ans << endl;
}
//system("pause");
return 0;
}