submission_id
stringlengths 5
9
| problem_id
stringlengths 3
6
| date
int64 -1
-1
| language
stringclasses 11
values | verdict
stringclasses 1
value | cpu_time
int64 -1
15k
| memory
int64 -1
1.07B
| code
stringlengths 16
11k
| source
stringclasses 1
value | testcount
int64 0
604
| lenght
int64 16
11k
|
---|---|---|---|---|---|---|---|---|---|---|
81892065 | 1000A | -1 | cpp | Accepted | 31 | 266,240 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int T;
int n;
string s[110];
map<string, int>ma;
vector<string>a[110];
int main()
{
scanf("%d", &n);
for (int i = 1; i <= n; i ++)
{
cin >> s[i];
ma[s[i]] ++;
a[s[i].size()].push_back(s[i]);
}
int cnt = n;
for (int i = 1; i <= n; i ++)
{
cin >> s[i];
if(ma[s[i]] > 0)
{
ma[s[i]]--;
cnt --;
continue;
}
}
cout << cnt << '\n';
} | codeforces | 37 | 461 |
39704953 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include "iostream"
#include "vector"
#include "map"
#include "math.h"
#include "string"
#include "algorithm"
#include "set"
#include <string.h>
using namespace std;
int N = 1e5;
typedef long long ll;
map<string,int> mp;
int main(){
ll n,ans=0;
string s;
cin >> n;
ans = n;
for(int i=0;i<n;i++){
cin>>s;
mp[s]++;
}
for(int i=0;i<n;i++){
cin >> s;
if(mp[s]){
mp[s]--;
ans--;
}
}
cout << ans << endl;
} | codeforces | 37 | 462 |
39708032 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin>>n;
map<string,int>mp;
for(int i=0;i<n;++i)
{
string s;
cin>>s;
mp[s]++;
}
int c=0;
for(int i=n;i<2*n;++i)
{
string s;
cin>>s;
if(mp.find(s)==mp.end() )
{
++c;
}
else
{
mp[s]--;
if(mp[s]==0)
{
mp.erase(s);
}
}
}
cout<<c<<"\n";
return 0;
} | codeforces | 37 | 462 |
39739405 | 1000A | -1 | cpp | Accepted | 30 | 12,288 | #include <iostream>
#include <vector>
#include <map>
using namespace std;
int main() {
int n; cin >> n;
vector <string> a;
map <string, int> b;
for (int i = 0; i < n; i++) {
string t; cin >> t;
a.push_back(t);
}
for (int i = 0; i < n; i++) {
string t; cin >> t;
b[t]++;
}
int matched = 0;
for (int i = 0; i < n; i++) {
if (b[a[i]] > 0) { matched++; b[a[i]]--; }
}
cout << n - matched;
return 0;
} | codeforces | 37 | 462 |
124636636 | 1000A | -1 | cpp | Accepted | 30 | 3,911,680 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
map<string,int> m;int i,ans;string s;
for(i=0;i<n;i++)
{
cin>>s;
m[s]++;
}
ans=0;
for(i=0;i<n;i++)
{
cin>>s;
if(m[s])
m[s]--;
else ans++;
}
printf("%d\n",ans);
}
return 0;
}
| codeforces | 37 | 462 |
39706529 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<bits/stdc++.h>
using namespace std;
#define fr first
#define sec second
#define ll long long
#define si size()
#define ss ios::sync_with_stdio(0),cin.tie(0);
int main()
{
int n;
cin>>n;
map<string,int>m;
string s[n],s1;
for (int i=0;i<n;i++)
{cin>>s[i];
}
for (int i=0;i<n;i++)
{cin>>s1;
m[s1]++;}
int c=0;
for (int i=0;i<n;i++)
{
if (m[s[i]])
{m[s[i]]--;
}
else
c++;
}
cout<<c;
return 0;
}
| codeforces | 37 | 463 |
39706529 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<bits/stdc++.h>
using namespace std;
#define fr first
#define sec second
#define ll long long
#define si size()
#define ss ios::sync_with_stdio(0),cin.tie(0);
int main()
{
int n;
cin>>n;
map<string,int>m;
string s[n],s1;
for (int i=0;i<n;i++)
{cin>>s[i];
}
for (int i=0;i<n;i++)
{cin>>s1;
m[s1]++;}
int c=0;
for (int i=0;i<n;i++)
{
if (m[s[i]])
{m[s[i]]--;
}
else
c++;
}
cout<<c;
return 0;
}
| codeforces | 37 | 463 |
39791881 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include<bits/stdc++.h>
#define ED end()
#define BG begin()
#define PB push_back
#define MP make_pair
#define ll long long
#define pii pair<int,int>
#define Size size()
#define test_
using namespace std;
map<string,int> mp;
int main(){
int n; cin>>n;
for(int i=0;i<n;i++){
string x; cin>>x;
mp[x]++;
}
for(int i=0;i<n;i++){
string x;cin>>x;
mp[x]--;
}
int ans=0;
for(auto &i:mp){
ans+=abs(i.second);
}
cout<<ans/2;
}
| codeforces | 37 | 463 |
50136798 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
unordered_map<string, int> t1, t2;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
t1[s]++;
}
for (int i = 0; i < n; i++) {
string s;
cin >> s;
t2[s]++;
}
int ans = 0;
vector<string> ss = {"S", "M", "L", "XS", "XXS", "XXXS", "XL", "XXL", "XXXL"};
for (auto &s : ss) {
if (t2[s] > t1[s]) {
ans += t2[s] - t1[s];
}
}
printf("%d\n", ans);
return (0);
}
| codeforces | 37 | 463 |
70820837 | 1000A | -1 | cpp | Accepted | 46 | 147,456 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
multiset<string> st;
for (int i = 0; i < n; ++i) {
string pre;
cin >> pre;
st.insert(pre);
}
int ans = n;
for (int i = 0; i < n; ++i) {
string cur;
cin >> cur;
if (st.count(cur)) {
--ans;
st.erase(st.find(cur));
}
}
cout << ans << '\n';
return 0;
} | codeforces | 37 | 463 |
72621472 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<iostream>
#include<map>
#include<string>
using namespace std;
map<string,int >mp1,mp2;
int main()
{
mp1.clear();
mp2.clear();//全变成0
string s[110];
int n;
int ans=0;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>s[i];
mp1[s[i]]++;
}
string str;
for(int i=1;i<=n;i++)
{
cin>>str;
if(!mp1[str]) ans++;
else
mp1[str]--;//如果出现过就直接变过来 之前存的建议,没出现过就得自己编 就+1
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 463 |
115943160 | 1000A | -1 | cpp | Accepted | 31 | 3,903,488 | #include<stdio.h>
#include<string.h>
#include<math.h>
#include<map>
#include<iostream>
#include<algorithm>
using namespace std;
map<string,int>m;
int main()
{
char s[200];
int n,ans=1,sum=0;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%s",s);
m[s]++;
}
for(int i=0;i<n;i++)
{
scanf("%s",s);
if(!m[s])
sum++;
else
m[s]--;
}
printf("%d\n",sum);
}
| codeforces | 37 | 463 |
122032418 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<iostream>
#include<cstring>
#include<map>
using namespace std;
string a[110], b[110];
map<string, int>mp;
int main()
{
int n;
cin >> n;
int ans = 0;
for (int i = 0; i < n; i++)
{
cin >> a[i];
mp[a[i]]++;
}
for (int i = 0; i < n; i++)
{
cin >> b[i];
if (mp[b[i]] == 0)
ans++;
else
mp[b[i]]--;
}
cout << ans << endl;
}
| codeforces | 37 | 463 |
39741738 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
map<string, int> cnt;
int n;
int main() {
cin >> n;
for(int i = 1; i <= n; ++i) {
string s;
cin >> s;
cnt[s]++;
}
for(int i = 1; i <= n; ++i) {
string s;
cin >> s;
cnt[s]--;
}
int ans = 0;
for(auto i : cnt) {
ans += abs(i.second);
}
cout << ans/2 << endl;
return 0;
}
| codeforces | 37 | 464 |
39741738 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
map<string, int> cnt;
int n;
int main() {
cin >> n;
for(int i = 1; i <= n; ++i) {
string s;
cin >> s;
cnt[s]++;
}
for(int i = 1; i <= n; ++i) {
string s;
cin >> s;
cnt[s]--;
}
int ans = 0;
for(auto i : cnt) {
ans += abs(i.second);
}
cout << ans/2 << endl;
return 0;
}
| codeforces | 37 | 464 |
40498897 | 1000A | -1 | cpp | Accepted | 31 | 0 | #include <cstdio>
#include <cstring>
int n;
int cnt[5][256];
char s[10];
int ans;
int main() {
scanf("%d", &n);
for(int i=0; i<n; i++) {
scanf("%s", s);
int len = strlen(s);
cnt[len][s[len-1]]++;
}
for(int i=0; i<n; i++) {
scanf("%s", s);
int len = strlen(s);
if(cnt[len][s[len-1]]==0)
ans++;
else
cnt[len][s[len-1]]--;
}
printf("%d\n", ans);
return 0;
} | codeforces | 37 | 464 |
45253281 | 1000A | -1 | cpp | Accepted | 31 | 249,856 | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define dl double
#define lp for(ll i=0; i<n; i++)
#define lp2 for(ll j=0; j<m; j++)
#define lps for(ll i=0; i+1<len; i++)
int main()
{
ll n;
cin>>n;
map< string, ll>mp;
string st;
lp{
cin>>st;
mp[st]++;
}
ll coun=0;
lp{
cin>>st;
if(mp[st]!=0){
coun++;
mp[st]--;
}
}
cout<<(n-coun)<<endl;
}
| codeforces | 37 | 464 |
67002393 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
string a[n],b[n];
map<string,int>mp;
for(int i=0;i<n;i++)
{
cin>>a[i];
mp[a[i]]++;
}
for(int i=0;i<n;i++)
{
cin>>b[i];
mp[b[i]]--;
}
int ans=0;
for(map<string,int>::iterator it=mp.begin();it!=mp.end();it++)
{
int k=it->second;
ans+=max(0,k);
}
cout<<ans;
}
| codeforces | 37 | 464 |
75574201 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include <bits/stdc++.h>
#define DAU ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define PLEC return 0;
using namespace std;
unordered_map<string, int> freq;
int n, res;
string s;
int main() {
DAU
cin >> n;
for (int i = 1; i <= n; ++i)
cin >> s, ++freq[s];
for (int i = 1; i <= n; ++i) {
cin >> s;
if (freq[s] > 0)
--freq[s];
else ++res;
}
cout << res;
PLEC
}
| codeforces | 37 | 464 |
79904054 | 1000A | -1 | cpp | Accepted | 31 | 3,985,408 | //生存的原因引起了生存的原因
#include <bits/stdc++.h>
#define int long long int
using namespace std;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
//xxxs, xxs, xs, s , m ,l , xl , xxl ,xxxl
map<string,int> freq;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
string str;
cin>>str;
freq[str]++;
}
for(int i=0;i<n;i++)
{
string str;
cin>>str;
freq[str]--;
}
int ans=0;
for(auto&itr:freq)
ans+=max(0LL,itr.second);
cout<<ans;
return 0;
} | codeforces | 37 | 464 |
39704966 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
map<string, int> mp;
int main(){
int n;
scanf("%d", &n);
string s;
for(int i = 1;i <= n;++i){
cin >> s;
mp[s]++;
}
int ans = 0;
for(int i = 1;i <= n;++i){
cin >> s;
if(mp[s] > 0)mp[s]--;
else ans++;
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 465 |
39705068 | 1000A | -1 | cpp | Accepted | 30 | 12,288 | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n; scanf("%d", &n);
map<string, int> aa;
string a[n];
for (int i = 0; i < n; i ++)
{
cin >> a[i];
if (!aa.count(a[i]))
aa[a[i]] = 1;
else
aa[a[i]] ++;
}
int s = 0; string b;
for (int i = 0; i < n; i ++)
{
cin >> b;
if (!aa.count(b))
s ++;
else
{
if (aa[b] <= 0) s ++;
aa[b] --;
}
}
printf("%d\n", s);
return(0);
} | codeforces | 37 | 465 |
39705384 | 1000A | -1 | cpp | Accepted | 31 | 32,768 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,ans=0;;
string team[1005];
scanf("%d",&n);
for(int i=0;i<n;i++)
cin>>team[i];
string now;
for(int i=0;i<n;i++)
{
cin>>now;
int t=1;
for(int j=0;j<n;j++)if(now==team[j])
{
t=0;
team[j]="\0";
break;
}
if(t)ans++;
}
printf("%d",ans);
return 0;
}
| codeforces | 37 | 465 |
39768608 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
string a[111], b[111];
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n; cin >> n;
for(int i = 0 ; i < n ; i++){
cin >> a[i];
mp[a[i]]++;
}
for(int i = 0 ; i < n ; i++){
cin >> b[i];
mp[b[i]]--;
}
int ans = 0;
for(map<string,int>::iterator it = mp.begin() ; it != mp.end() ; it++){
ans += abs(it->second);
}
cout << ans/2 << endl;
}
| codeforces | 37 | 465 |
39768608 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
string a[111], b[111];
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n; cin >> n;
for(int i = 0 ; i < n ; i++){
cin >> a[i];
mp[a[i]]++;
}
for(int i = 0 ; i < n ; i++){
cin >> b[i];
mp[b[i]]--;
}
int ans = 0;
for(map<string,int>::iterator it = mp.begin() ; it != mp.end() ; it++){
ans += abs(it->second);
}
cout << ans/2 << endl;
}
| codeforces | 37 | 465 |
42242546 | 1000A | -1 | cpp | Accepted | 31 | 0 | #include<bits/stdc++.h>
#define ll long long
using namespace std;
vector<string> v;
int main()
{
int n;
cin>>n;
string b[105];
for(int i=1;i<=n;i++)
{
string a;
cin>>a;
v.push_back(a);
}
for(int i=1;i<=n;i++)
{
cin>>b[i];
}
int ans=0;
for(int i=1;i<=n;i++)
{
vector<string>::iterator it;
it = find(v.begin(),v.end(),b[i]);
if(it!=v.end())
{
v.erase(it);
}
else
{
ans++;
}
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 465 |
84258752 | 1000A | -1 | cpp | Accepted | 46 | 8,192 | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
#define pb push_back
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n;
cin>>n;
map <string, ll> m;
string s;
for(ll i=0;i<n;i++){
cin>>s;
m[s]++;
}
ll count = 0;
for(ll i=0;i<n;i++){
cin>>s;
m[s]--;
if(m[s]<0){
count++;
}
}
cout<<count<<"\n";
} | codeforces | 37 | 465 |
58808205 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <iostream>
#include <cstdio>
#include <map>
using namespace std;
map<string, int> m;
int main() {
int n;
cin >> n;
string s;
for (int i = 1; i <= n; ++i) {
cin >> s;
++m[s];
}
for (int i = 1; i <= n; ++i) {
cin >> s;
--m[s];
}
map<string, int> :: iterator es = m.end();
int ans = 0;
for (map<string, int> :: iterator it = m.begin(); it != es; ++it)
ans += max(0, it -> second);
cout << ans << endl;
return 0;
} | codeforces | 37 | 466 |
39704708 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
const int N=1e6+5;
int n, same;
map<string, int> mapa, mapa2;
string s;
int main()
{
ios_base::sync_with_stdio(0);
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>s;
mapa[s]++;
}
for(int i=1;i<=n;i++)
{
cin>>s;
mapa2[s]++;
}
for(auto x : mapa) same+=min(mapa[x.first], mapa2[x.first]);
n -= same;
cout<<n;
return 0;
} | codeforces | 37 | 467 |
41306349 | 1000A | -1 | cpp | Accepted | 31 | 36,864 | #include <iostream>
#include <conio.h>
#include <string>
#include <vector>
using namespace std;
int main()
{
int n;
vector <string> a;
cin >> n;
string temp;
for (int i = 0; i < n; i++)
{
cin >> temp;
a.push_back(temp);
}
for (int i = 0; i < n; i++)
{
cin >> temp;
for (int j = 0;j < a.size(); j++) {
if (a[j] == temp) {
a.erase(a.begin() + j);
break;
}
}
}
cout << a.size();
//_getch();
return 0;
} | codeforces | 37 | 467 |
41306349 | 1000A | -1 | cpp | Accepted | 31 | 36,864 | #include <iostream>
#include <conio.h>
#include <string>
#include <vector>
using namespace std;
int main()
{
int n;
vector <string> a;
cin >> n;
string temp;
for (int i = 0; i < n; i++)
{
cin >> temp;
a.push_back(temp);
}
for (int i = 0; i < n; i++)
{
cin >> temp;
for (int j = 0;j < a.size(); j++) {
if (a[j] == temp) {
a.erase(a.begin() + j);
break;
}
}
}
cout << a.size();
//_getch();
return 0;
} | codeforces | 37 | 467 |
61395819 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
const int N = 200 + 7;
int n;
string s[N], c;
int vis[N];
int ans;
int main() {
cin >> n;
for (int i = 1; i <= n; ++i)
cin >> s[i];
for (int i = 1; i <= n; ++i) {
cin >> c;
for (int j = 1; j <= n; ++j)
if (!vis[j] && s[j] == c) {
vis[j] = 1;
break;
}
}
for (int i = 1; i <= n; ++i)
ans += vis[i] ^ 1;
cout << ans;
return 0;
}
| codeforces | 37 | 467 |
102338194 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
using namespace std;
#define ll long long
//#define push_back pb
int main(){
ll t;
t=1;
//cin>>t;
while(t--){
ll n;
cin>>n;
string s1,s2;
map<string,int> mp;
int c=0;
for(int i=0;i<n;i++){
cin>>s1;mp[s1]++;
}
for(int i=0;i<n;i++){
cin>>s1;
if(mp[s1]>0){
mp[s1]--;
}
else{
c++;
}
}
cout<<c<<endl;
}
}
| codeforces | 37 | 467 |
39704352 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <queue>
#include <map>
#include <vector>
using namespace std;
map<string, int> d;
int main()
{
int n, dap = 0;
char f[100];
string a;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> f;
a = f;
d[a]++;
}
for (int i = 1; i <= n; i++)
{
cin >> f;
a = f;
if (d[a] == 0)
{
dap++;
}
else
d[a]--;
}
cout << dap;
} | codeforces | 37 | 468 |
39705350 | 1000A | -1 | cpp | Accepted | 30 | 4,820,992 | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
string a[N], b[N];
map<string, int> maps;
int main() {
cin >> n;
for(int i = 1; i <= n; i++) cin >> a[i];
for(int i = 1; i <= n; i++) cin >> b[i];
for(int i = 1; i <= n; i++) {
maps[a[i]] += 1;
}
int ans = 0;
for(int j = 1; j <= n; j++) {
if (maps[b[j]] > 0) {
maps[b[j]] -= 1;
ans += 1;
}
}
printf("%d\n",n - ans);
return 0;
} | codeforces | 37 | 468 |
39706667 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int n;
int main() {
cin >> n;
map<string, int> ttt;
string tts;
int ans = 0;
for(int i = 0; i < n; i ++) {
cin >> tts;
ttt[tts] ++;
}
for(int i = 0; i < n; i ++) {
cin >> tts;
if(ttt.find(tts) != ttt.end() and ttt[tts]) {
ttt[tts] --;
}
else ans ++;
}
cout << ans << endl;
} | codeforces | 37 | 468 |
39721306 | 1000A | -1 | cpp | Accepted | 30 | 16,384 | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
string a[n],b[n];
int i,j,k,c=0;
for(i=0;i<n;i++){
cin>>a[i];
}
for(i=0;i<n;i++){
cin>>b[i];
}
c=0;
for(j=0;j<n;j++){
for(k=0;k<n;k++){
if(a[j]==b[k]){
c++;
a[j]="ABC";
b[k]="DEF";
continue;
}
}
}
cout<<n-c;
return 0;
}
| codeforces | 37 | 468 |
40095690 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll n;
cin>>n;
map<string,pair<ll,ll> > m;
for (ll i = 0; i < n; i++) {
string s;
cin>>s;
m[s].first++;
}
for (ll i = 0; i < n; i++) {
string s;
cin>>s;
m[s].second++;
}
ll ans=0;
for (auto &el:m) {
ans += abs(el.second.first - el.second.second);
}
cout << ans / 2;
} | codeforces | 37 | 468 |
42287719 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int main(void){
int n;
cin>>n;
map<string, int> mymap;
for(int i=0;i<n;i++){
string s;
cin>>s;
mymap[s]++;
}
for(int i=0;i<n;i++){
string s;
cin>>s;
mymap[s]--;
}
int res=0;
for(auto it=mymap.begin(); it!=mymap.end();++it){
if(it->second>0) res+=it->second;
}
cout<<res<<"\n";
return 0;
}
| codeforces | 37 | 468 |
42422970 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll n;
cin>>n;
unordered_map<string,int> mp;
for(int i=0;i<n;i++){
string s;
cin>>s;
mp[s]++;
}
for(int i=0;i<n;i++){
string s;
cin>>s;
mp[s]--;
}
ll ans=0;
ans+=max(0,mp["M"])+max(0,mp["L"])+max(0,mp["S"]);
ans+=max(0,mp["XL"])+max(0,mp["XS"]);
ans+=max(0,mp["XXL"])+max(0,mp["XXS"]);
ans+=max(0,mp["XXXL"])+max(0,mp["XXXS"]);
cout<<ans;
} | codeforces | 37 | 468 |
39704349 | 1000A | -1 | cpp | Accepted | 30 | 6,246,400 | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pub push_back
#define pob pop_back
#define pq priority_queue
#define ext exit(0)
#define ff first
#define ss second
ll n,a[111111],i,ans;
string s[111111],s1[111111];
map<string , ll>m;
int main () {
cin>>n;
for(i=1;i<=n;i++){
cin>>s[i];
m[s[i]]++;
}
for(i=1;i<=n;i++){
cin>>s1[i];
if(m[s1[i]]) m[s1[i]]--;
else ans++;
}
cout<<ans;
} | codeforces | 37 | 469 |
39704670 | 1000A | -1 | cpp | Accepted | 30 | 24,576 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const int N = 1e5 + 5;
map<string, int> Map;
int main()
{
int n; cin >> n;
for (int i = 0; i < n; i++)
{
string s; cin >> s;
Map[s]++;
}
int ans = 0;
for (int i = 0; i < n; i++)
{
string s; cin >> s;
if (Map[s] == 0) ans++;
else Map[s]--;
}
cout << ans << endl;
return 0;
}
| codeforces | 37 | 469 |
39725832 | 1000A | -1 | cpp | Accepted | 15 | 20,480 | #include<bits/stdc++.h>
#define ll long long int
#define pb push_back
using namespace std;
string a[105],b[105];
map<string,ll>m;
int main()
{
ll n,ans=0;
scanf("%lld",&n);
for(ll i=0;i<n;i++)
{
cin>>a[i];
}
for(ll i=0;i<n;i++)
{
cin>>b[i];
m[b[i]]++;
}
for(ll i=0;i<n;i++)
{
if(m.count(a[i])&&m[a[i]]>0)m[a[i]]--;
else ans++;
}
printf("%lld\n",ans);
}
| codeforces | 37 | 469 |
40710074 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include <iostream>
#include <iomanip>
#include <cmath>
#include <cstring>
using namespace std;
int main()
{
string a[100];
string b[100];
int n;
int i;
int j;
cin>>n;
int sum=n;
for (i=0;i<n;i++){cin>> a[i];}
for (j=0;j<n;j++){cin>> b[j];}
for (j=0;j<n;j++){
for (i=0;i<n;i++){
if(b[j]==a[i]){
sum--;
a[i]="0";
break;}}}
cout<< sum;
return 0;
}
| codeforces | 37 | 469 |
52456805 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
char s[205][10];
bool v[205];
int main(){
int n,ans=0;;
scanf("%d",&n);
for(int i=0;i<2*n;i++){
scanf("%s",s[i]);
}
memset(v,false,sizeof(v));
for(int i=0;i<n;i++){
for(int j=n;j<2*n;j++){
if(!strcmp(s[i],s[j])&&!v[j]){
ans++;v[j]=true;break;
}
}
}
printf("%d\n",n-ans);
return 0;
}
| codeforces | 37 | 469 |
115760401 | 1000A | -1 | cpp | Accepted | 31 | 4,313,088 | #include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n; cin >> n;
map<string, int> mp;
for(int i = 0; i < n; i ++){
string s; cin >> s;
mp[s] ++;
}
int res = 0;
for(int i = 0; i < n; i ++){
string s; cin >> s;
if(mp[s]) mp[s] --;
else res ++;
}
cout << res;
return 0;
}
| codeforces | 37 | 469 |
39715010 | 1000A | -1 | cpp | Accepted | 15 | 8,192 | #include <bits/stdc++.h>
std::map<std::string, int> w;
int main(void) {
#ifdef MYPC
freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#endif
int n; scanf("%d", &n);
for (int i = 0; i < n; i++) {
std::string s;
std::cin >> s;
w[s] += 1;
}
int res = 0;
for (int i = 0; i < n; i++) {
std::string s;
std::cin >> s;
if (w[s] > 0)
w[s]--;
else
res++;
}
printf("%d", res);
} | codeforces | 37 | 470 |
39734102 | 1000A | -1 | cpp | Accepted | 15 | 12,288 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n; cin>>n;
string s[n],a[n];
for(ll i=0;i<n;i++)
cin>>s[i];
ll f=0;
for(ll i=0;i<n;i++)
{ cin>>a[i];
for(ll j=0;j<n;j++)
{
if(s[j]==a[i])
{ f++;
s[j]='0';
break;
}
}
}
cout<<n-f<<endl;
}
| codeforces | 37 | 470 |
40097326 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include <bits/stdc++.h>
using namespace std;
main () {
int n; cin >> n;
multiset<string> s[100], GG[100];
for(int i = 1; i <= n; i ++) {
string str; cin >> str;
s[str.size()].insert(str);
}
for(int i = 1; i <= n; i ++) {
string str; cin >> str;
if(s[str.size()].count(str)) s[str.size()].erase(s[str.size()].find(str));
else GG[str.size()].insert(str);
}
int ans = 0;
for(int i = 0; i < 100; i ++) ans += GG[i].size();
cout << ans;
} | codeforces | 37 | 470 |
54544752 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll n;
cin>>n;
string a[n];
ll ans=0;
for(ll i=0;i<n;i++)
{
cin>>a[i];
}
for(ll i=0;i<n;i++)
{
string s;
cin>>s;
for(ll j=0;j<n;j++)
{
if(a[j]==s)
{
ans++;
a[j]="kkk";
break;
}
}
}
cout<<n-ans<<endl;
} | codeforces | 37 | 470 |
54544752 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll n;
cin>>n;
string a[n];
ll ans=0;
for(ll i=0;i<n;i++)
{
cin>>a[i];
}
for(ll i=0;i<n;i++)
{
string s;
cin>>s;
for(ll j=0;j<n;j++)
{
if(a[j]==s)
{
ans++;
a[j]="kkk";
break;
}
}
}
cout<<n-ans<<endl;
} | codeforces | 37 | 470 |
61322096 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include <cstdio>
#include <algorithm>
#include <map>
#include <cstring>
#include <string>
#include <iostream>
using namespace std ;
int n ;
map < string , int > mp ;
int main ( void ) {
scanf ( "%d" , & n ) ;
int t = n ;
string tmp ;
while ( t --){
cin >> tmp ;
mp [ tmp ]++;
}
t = n ;
int ans = 0 ;
while ( t --){
cin >> tmp ;
if ( mp [ tmp ] ) {
mp [ tmp ] --;
}
else {
ans++;
}
}
printf ( "%d\n" , ans ) ;
return 0 ;
}
| codeforces | 37 | 470 |
39707638 | 1000A | -1 | cpp | Accepted | 31 | 24,576 | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int n,ans;
vector <string> a,b;
string x;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>x;
a.push_back(x);
}
for(int i=0;i<n;i++){
cin>>x;
b.push_back(x);
}
int m=n;
for(int i=0;i<n;i++)
for(int j=0;j<b.size();j++){
if(a[i]==b[j]){
b[j].erase();
ans++;
j=b.size();
}
}
ans=n-ans;
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 471 |
39821047 | 1000A | -1 | cpp | Accepted | 31 | 188,416 | #include<iostream>
using namespace std;
struct lala
{
char c[300];
};
int main()
{
int n;
struct lala a[300];
struct lala b[300];
while (cin >> n)
{
int i, j, k;
for(i = 0; i < n; i++)
cin >> a[i].c;
for(i = 0; i < n; i++)
cin >> b[i].c;
int sum = n;
for (j = 0; j < i; j++)
for (k = 0; k < i; k++)
{
if (strcmp(a[j].c, b[k].c) == 0)
{
b[k].c[0] = 'haha';
sum--;
break;
}
}
cout << sum << endl;
}
return 0;
}
| codeforces | 37 | 471 |
40030776 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include<iostream>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<map>
using namespace std;
map<string,int> m;
int n;
string s;
int main()
{
cin>>n;
for(int i=0;i<n;i++)
{
cin>>s;
m[s]++;
}
for(int i=0;i<n;i++)
{
cin>>s;
if(m.find(s)!=m.end()&&m[s]>0) m[s]--;
}
n=0;
for(map<string,int>::iterator it=m.begin();it!=m.end();it++)
{
n+=it->second;
}
cout<<n<<endl;
return 0;
} | codeforces | 37 | 471 |
41231937 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include<iostream>
#include<cstring>
#include<algorithm>
#include<map>
using namespace std;
map<string,int>m1;
map<string,int>m2;
int main()
{
int n,i,j,sum=0;
string s[105],x;
m1.clear();
m2.clear();
cin>>n;
for(i=0;i<n;i++)
{
cin>>s[i];
m1[s[i]]++;
}
for(j=0;j<n;j++)
{
cin>>x;
if(!m1[x])
sum++;
else
m2[x]++;
}
for(i=0;i<n;i++)
{
if(m2[s[i]]-m1[s[i]]>0)
{
sum+=m2[s[i]]-m1[s[i]];
m2[s[i]]=-1;
}
}
cout<<sum<<endl;
return 0;
} | codeforces | 37 | 471 |
42023900 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <iostream>
#include <map>
#include <string>
using namespace std;
void in(int n, map<string, int> &mp) {
for (int i = 1; i <= n; i++) {
string s;
cin >> s;
mp[s]++;
}
}
int main() {
int n;
scanf("%d", &n);
map<string, int> mp1, mp2;
in(n, mp1); in(n, mp2);
int ans = n;
for (auto p : mp1) ans -= min(p.second, mp2[p.first]);
cout << ans << "\n";
return 0;
}
| codeforces | 37 | 471 |
76483863 | 1000A | -1 | cpp | Accepted | 31 | 7,770,112 | #include<bits/stdc++.h>
using namespace std;
const int N = 1000 * 100 + 20;
string b[N], a[N];
pair <int, string> s[N];
int main() {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int n;
cin >> n;
map <string , int> mpa, mpb;
for (int i = 1; i <= n; i++) {
cin >> a[i];
mpa[a[i]]++;
}
for (int i = 1; i <= n; i++) {
cin >> b[i];
mpb[b[i]]++;
}
int cnt = 0;
for (auto i: mpa)
cnt += min(i.second, mpb[i.first]);
cout << n - cnt;
return 0;
}
| codeforces | 37 | 471 |
39721832 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<iostream>
#include<vector>
#include<map>
#include<string>
using namespace std;
vector<string>v,va;
int n;
bool sol(string s){
for(int i=0;i<v.size();i++)
if(v[i]==s){
v.erase(v.begin()+i);
return true;
}
return false;
}
int main ()
{
cin>>n;
v.resize(n); va.resize(n);
for(int i=0;i<n;i++)cin>>v[i];
for(int i=0;i<n;i++)cin>>va[i];
int ans=0;
for(int i=0;i<n;i++)
if(!sol(va[i]))ans++;
cout<<ans<<endl;
return 0;
} | codeforces | 37 | 472 |
72568959 | 1000A | -1 | cpp | Accepted | 31 | 2,015,232 | #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[1001][1000],b[1000][1000];
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<n;i++)
cin>>b[i];
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(!strcmp(a[i],b[j]))
{
a[i][0]='Z';
b[j][0]='A';
}
}
}
int count=0;
for(int i=0;i<n;i++)
{
if(a[i][0]!='Z')
count++;
}
cout<<count;
return 0;
}
| codeforces | 37 | 472 |
39707284 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <bits/stdc++.h>
#define ll long long
#define all(v) v.begin(),v.end()
#define rep(i,x,n) for(int i=x;i<n; i++)
using namespace std;
int main()
{
int n;
cin>>n;
int c=n;
string s;
map<string,int>mp;
rep(i,0,n)
{
cin>>s;
mp[s]++;
}
rep(i,0,n)
{
cin>>s;
if (mp[s])
{
c--;
mp[s]--;
}
}
cout<<c<<endl;
return 0;
}
| codeforces | 37 | 473 |
39761371 | 1000A | -1 | cpp | Accepted | 30 | 3,547,136 | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll n;
cin>>n;
string a[n],b[n];
bool check[n];
memset(check,true,sizeof(check));
for(ll i=0;i<n;i++)
{
cin>>a[i];
}
for(ll i=0;i<n;i++)
{
cin>>b[i];
}
ll cnt=0;
for(ll i=0;i<n;i++)
{
for(ll j=0;j<n;j++)
{
if(a[i]==b[j] && check[j]==true)
{
cnt++;
check[j]=false;
break;
}
}
}
cout<<n-cnt<<endl;
return 0;
} | codeforces | 37 | 473 |
72263065 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<string> a(n), b(n);
for (auto it = a.begin(); it != a.end(); ++it) cin >> *it;
for (auto it = b.begin(); it != b.end(); ++it) cin >> *it;
map<string, int> _a, _b;
for (auto it = a.begin(); it != a.end(); ++it) ++_a[*it];
for (auto it = b.begin(); it != b.end(); ++it) ++_b[*it];
int ans = n;
for (auto it : _a) ans -= min(it.second, _b[it.first]);
cout << ans;
} | codeforces | 37 | 473 |
123003134 | 1000A | -1 | cpp | Accepted | 31 | 3,956,736 | #include<bits/stdc++.h>
using namespace std;
string a[1000],b[1000];
int main()
{
int n; cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=n;i++) cin>>b[i];
int ans=0;
for(int i=1;i<=n;i++)
{
int f=0;
for(int j=1;j<=n;j++)
{
if(a[i]!="1"&&b[j]!="1")
{
if(a[i]==b[j])
{ f=1;
a[i]="1"; b[j]="1";
break;
}
}
}
if(!f) ans++;
}
cout<<ans<<endl;
}
| codeforces | 37 | 473 |
39727362 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int main()
{
ll n;
cin>>n;
multiset<string> ms;
for(ll i=0;i<n;i++)
{
string str;
cin>>str;
ms.insert(str);
}
for(ll i=0;i<n;i++)
{
string str;
cin>>str;
auto ind=ms.find(str);
if(ind!=ms.end())
ms.erase(ind);
}
cout<<ms.size()<<endl;
return 0;
}
| codeforces | 37 | 474 |
40499130 | 1000A | -1 | cpp | Accepted | 31 | 24,576 | #include<bits/stdc++.h>
using namespace std;
int cmp(string a,string b)
{
return a.size()<b.size();
}
int main()
{
int n,sum=0,l,j;
string a[101],b[101];
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
cin>>b[i];
}
sort(a,a+n);
sort(a,a+n,cmp);
sort(b,b+n);
sort(b,b+n,cmp);
for(int i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(b[i]==a[j])
{
a[j]="";
break;
}
}
if(j==n)sum++;
}
cout<<sum;
return 0;
} | codeforces | 37 | 474 |
39727794 | 1000A | -1 | cpp | Accepted | 15 | 8,192 | # include <iostream>
# include <string>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, count = 0;
string a[105], b[105];
cin >> n;
for (int i = 0; i < n; ++i) cin >> a[i];
for (int i = 0; i < n; ++i) cin >> b[i];
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j)
if (a[i] == b[j]) { a[i] = b[j] = ""; ++count; break; }
cout << n - count << '\n';
return 0;
}
| codeforces | 37 | 475 |
40504191 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
string s[n],ss[n];
map <string, int> m;
for(int i = 0; i < n; i++){
cin >> s[i];
m[s[i]]++;
}
for(int i = 0; i < n; i++){
cin >> ss[i];
m[ss[i]]--;
}
int s1 = 0;
while(!m.empty()){
//cout << m.begin() -> first << " " << m.begin() -> second << endl;
if(m.begin() -> second >= 0)s1 += m.begin() -> second;
m.erase(m.begin());
}
cout << s1;
} | codeforces | 37 | 475 |
40701579 | 1000A | -1 | cpp | Accepted | 31 | 57,344 | #include<bits/stdc++.h>
using namespace std;
const int maxn=1000;
string s;
string mp1[maxn],mp2[maxn];
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
cin>>mp1[i];
}
for(int i=1;i<=n;i++){
cin>>mp2[i];
}
int ans=0;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++){
if(mp1[i]==mp2[j]){
ans++;
mp2[j]="0";
break;
}
}
cout<<n-ans<<endl;
}
| codeforces | 37 | 475 |
53263690 | 1000A | -1 | cpp | Accepted | 30 | 12,288 | #include <bits/stdc++.h>
#define pb push_back
using namespace std;
vector<string>v;
vector<string>v1;
int main()
{int n,counter=0;cin>>n;
string s;
for(int i=0;i<n;i++)
{cin>>s;
v.push_back(s);
}
for(int j=0;j<n;j++)
{
cin>>s;
v1.pb(s);
}
for(int k=0;k<v1.size();k++)
{
for(int e=0;e<v.size();e++)
{
if(v1[k]==v[e])
{
v.erase(v.begin()+e);break;
}
}
}cout<<v.size();
return 0;
}
| codeforces | 37 | 475 |
56057524 | 1000A | -1 | cpp | Accepted | 30 | 4,096 | #include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int main()
{
fast;
int n , i , ans=0;
cin>>n;
string s;
map <string, int> m;
for(int i=0; i<n; i++)
{
cin>>s;
m[s]++;
}
for(int i=0; i<n; i++)
{
cin>>s;
if(m[s]>0)
--m[s];
else
++ans;
}
cout<<ans;
return 0;
} | codeforces | 37 | 475 |
72570900 | 1000A | -1 | cpp | Accepted | 46 | 12,288 | #include<bits/stdc++.h>
using namespace std;
const int maxn=1e2+10;
int n;
int s[5][26],s1[5][26];
string a;
int sum;
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++){
cin>>a;
int len=a.length();
s[a.length()][a[len-1]-'A']++;
}
for(int i=1;i<=n;i++){
cin>>a;
int len=a.length();
s1[a.length()][a[len-1]-'A']++;
}
for(int i=1;i<=4;i++){
for(int j=0;j<26;j++){
sum+=abs(s[i][j]-s1[i][j]);
}
}
printf("%d\n",sum/2);
}
| codeforces | 37 | 475 |
120750897 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <iostream>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;
const int N = 110;
int n;
string a[N],b[N];
map<string,int> mp;
int main()
{
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=n;i++)
{
cin>>b[i];
mp[b[i]]++;
}
int ans = n;
for(int i=1;i<=n;i++)
if(mp.count(a[i]))
{
int x =mp[a[i]];
if(x<=0) continue;
ans--;
mp[a[i]]--;
}
printf("%d\n",ans);
return 0;
}
| codeforces | 37 | 475 |
41744325 | 1000A | -1 | cpp | Accepted | 30 | 4,096 | //
// Created by Administrator on 2018/8/18.
//
#include <iostream>
#include <map>
using namespace std;
int main(){
int n;
cin>>n;
map<string,int> mp;
for(int i=1;i<=n;++i){
string s;
cin>>s;
++mp[s];
}
for(int i=1;i<=n;++i){
string s;
cin>>s;
--mp[s];
}
int sum=0;
for(auto &p:mp){
if(p.second<0) sum+=-p.second;
}
cout<<sum<<endl;
return 0;
}
| codeforces | 37 | 476 |
72570857 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<iostream>
#include<cstring>
using namespace std;
int main()
{
char t[105][5];
char r[105][5];
int x[105],y[105];
for(int i=0;i<105;i++)
{
x[i]=0;y[i]=0;
}
int n,ans=0;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>t[i];
}
for(int i=0;i<n;i++)
{
cin>>r[i];
}
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(strcmp(t[i],r[j])==0&&x[i]==0&&y[j]==0)
{
ans++;
x[i]=1;
y[j]=1;
}
}
}
cout<<n-ans;
}
| codeforces | 37 | 476 |
39712525 | 1000A | -1 | cpp | Accepted | 30 | 12,288 | #include<iostream>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
using namespace std;
int main()
{
int n,i,j,b,l;
bool done;
string s;
map< string, int> mp;
cin>>n;
for(i=1; i<=n; i++)
{
cin>>s;
mp[s]++;
}
b=0;
for(i=0; i<n; i++)
{
cin>>s;
if(mp[s]) mp[s]--;
else b++;
}
cout<<b<<endl;
return 0;
}
| codeforces | 37 | 477 |
39713689 | 1000A | -1 | cpp | Accepted | 31 | 2,416,640 | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
char f,g;
string s,p;
map < string, int > mp;
string arr[100005],brr[105];
int main()
{
int i,j, x=0,y,n;
cin>>n;
for(i=1; i<=n; i++)
{
cin>>arr[i];
mp[arr[i]]+=1;
}
for(i=1; i<=n; i++)
{
cin>>brr[i];
if(mp[brr[i]]==0)
x++;
else
mp[brr[i]]-=1;
}
cout<<x<<endl;
}
| codeforces | 37 | 477 |
39801244 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int M =1e5 + 50;
#define mst(a,b) memset(a,b,sizeof(a))
#define rush() int T;cin>>T;while(T--)
map<string,int> vis;
int main() {
int n;
scanf("%d",&n);
for(int i=0;i<n;i++) {
string tmp;
cin>>tmp;
vis[tmp] ++;
}
int ans = 0;
for(int i=0;i<n;i++) {
string tmp;
cin>>tmp;
if(!vis[tmp]) {
ans++;
} else {
vis[tmp]--;
}
}
cout<<ans;
}
| codeforces | 37 | 477 |
78097888 | 1000A | -1 | cpp | Accepted | 31 | 249,856 | #include<bits/stdc++.h>
#define MAXN 105
#define reg register
#define inl inline
using namespace std;
int n,tot;
map <string,int> m;
int main()
{
ios::sync_with_stdio(0);
cin>>n;
for(reg int i=1;i<=n;i++)
{
reg string x;
cin>>x;
m[x]++;
}
for(reg int i=1;i<=n;i++)
{
reg string x;
cin>>x;
if(m[x]) m[x]--;
else tot++;
}
printf("%d\n",tot);
return 0;
}
| codeforces | 37 | 477 |
118496968 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
long long n,i,k,h,m,t,j;
map<string, long long> a1,b1;
string a[107];
string b[107];
int main()
{
cin >> n;
for (i=1;i<=n;i++)
{
cin >> a[i];
a1[a[i]]++;
}
for (i=1;i<=n;i++)
{
cin >> b[i];
b1[b[i]]++;
}
k=0;
for (auto m:a1)
{
k+= min(m.second, b1[m.first]);
}
cout << n-k << endl;
return 0;
}
| codeforces | 37 | 477 |
39733445 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
string s;
vector <string> s1,s2;
int i;
for(i=0; i<n; i+=1){
cin>>s;
s1.push_back(s);
}
for(i=0; i<n; i+=1){
cin>>s;
s2.push_back(s);
}
int c=0;
for(i=0; i<n; i+=1){
for(int j=0; j<n; j+=1){
if(s1[i]==s2[j]){
c+=1;
s2[j]='*';
break;
}
}
}
cout<<n-c<<endl;
}
| codeforces | 37 | 478 |
40509472 | 1000A | -1 | cpp | Accepted | 31 | 24,576 | #include<iostream>
#include<cstring>
#include<map>
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
const int maxn=105;
string a[maxn],b[maxn];
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
cin>>b[i];
}
int ans=0;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(a[i]==b[j])
{
ans++;
b[j]="";
a[i]="0";
}
}
}
cout<<n-ans<<endl;
return 0;
} | codeforces | 37 | 478 |
46774119 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n;
cin>>n;
string arr[n];
string arr1[n];
for(int i=0;i<n;i++)
cin>>arr[i];
for(int i=0;i<n;i++)
cin>>arr1[i];
for(int i=0;i<n;i++)
{
int x=0;
for(int j=0;j<n;j++)
{
if(arr[i]==arr1[j])
{
arr[i]="";
arr1[j]="";
x=1;
break;
}
}
}
sort(arr, arr+n);
sort(arr1, arr1+n);
int c=0;
for(int i=0;i<n;i++)
{
if(arr[i]!="")
c++;
}
cout<<c<<endl;
} | codeforces | 37 | 478 |
61806220 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
using namespace std;
typedef long long int ll;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n; cin >> n;
map<string,int> mp;
for(int i=0;i<n;i++){
string s; cin >> s;
mp[s]++;
}
for(int i=0;i<n;i++){
string s; cin >> s;
mp[s]--;
}
int ans=0;
for(auto c:mp){
ans+=abs(c.second);
}
cout << ans/2 << endl;
} | codeforces | 37 | 478 |
74622293 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<bits/stdc++.h>
#define lli long long int
#define N 1000001
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
lli n,i,j,c=0;
cin>>n;
string s[n],str[n];
for(i=0;i<n;i++)
cin>>s[i];
for(i=0;i<n;i++)
cin>>str[i];
for(i=0;i<n;i++)
for(j=0;j<n;j++)
if(s[i]==str[j])
{
s[i]="-1";
str[j]="-2";
c++;
}
cout<<n-c<<endl;
return 0;
} | codeforces | 37 | 478 |
111766739 | 1000A | -1 | cpp | Accepted | 31 | 32,768 | #include<bits/stdc++.h>
using namespace std;
int n,m,c[105],d[105];
char a[105],b[105];
int main()
{
cin>>n;
m=n;
for(int i=1;i<=n;i++)
{
cin>>a[i];
c[i]+=int(a[i]);
if(a[i]=='X')
{
i--;
}
}
for(int i=1;i<=n;i++)
{
cin>>b[i];
d[i]+=int(b[i]);
if(b[i]=='X')
{
i--;
}
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
if(c[i]==d[j])
{
c[i]=0;
d[j]=1;
m--;
}
}
}
cout<<m;
return 0;
}
| codeforces | 37 | 478 |
39704378 | 1000A | -1 | cpp | Accepted | 30 | 12,288 | #include <bits/stdc++.h>
using namespace std;
const int _5 = 100005, _6 = 1000006;
#define pb push_back
typedef long long ll;
int n, cnt;
string s;
map<string, int> mp;
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt" , "r" , stdin);
#endif
cin>>n;
for (int i = 0; i < n; ++i){
cin>>s;
mp[s]++;
}
for (int i = 0; i < n; ++i){
cin>>s;
if(mp[s]){
mp[s]--;
}else cnt++;
}
cout<<cnt<<endl;
return 0 ;
} | codeforces | 37 | 479 |
40500558 | 1000A | -1 | cpp | Accepted | 30 | 151,552 | #include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <set>
using namespace std;
int n, ans;
string s;
map<string, int> a, b;
set<string> ss;
int main() {
cin >> n;
ans = n;
for (int i = 0; i < n; i++) {
cin >> s;
a[s]++;
ss.insert(s);
}
for (int i = 0; i < n; i++) {
cin >> s;
b[s]++;
ss.insert(s);
}
set<string>::iterator it;
for (it = ss.begin(); it != ss.end(); it++) {
ans -= min(a[*it], b[*it]);
}
cout << ans << endl;
} | codeforces | 37 | 479 |
42013741 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <iostream>
#include <utility>
#include <algorithm>
#include <map>
#include <string>
using namespace std;
int main() {
int n; cin >> n;
int ans = 0;
map<string, int> foo;
int t = n;
while (t--) {
string a; cin >> a;
++foo[a];
}
while (n--) {
string b; cin >> b;
if (foo[b] != 0) --foo[b];
}
for (auto const & x : foo) {
ans += x.second;
}
cout << ans;
return 0;
} | codeforces | 37 | 479 |
51088683 | 1000A | -1 | cpp | Accepted | 31 | 24,576 | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
int n;
cin>>n;
int i,k,p,j;
int m=n;
string a[n],b[n];
for(i=0;i<n;i++)
cin>>a[i];
for(k=0;k<n;k++)
cin>>b[k];
for(p=0;p<n;p++)
{
for(j=0;j<n;j++){
if(b[j]==a[p])
{
m--;
b[j]="gfdgdfg";
break;
}
}
}
cout<<m<<endl;;
return 0;
}
| codeforces | 37 | 479 |
122560336 | 1000A | -1 | cpp | Accepted | 31 | 3,743,744 | #include<set>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>
#include<map>
#include<stack>
#include<queue>
#include<vector>
#include<list>
typedef long long LL;
using namespace std;
int main(){
int ans=0,n;
cin>>n;
string a;
map<string,int>s;
for(int i=0;i<n;i++){
cin>>a;
s[a]++;
}
for(int i=0;i<n;i++){
cin>>a;
if(s[a]==0)
ans++;
else
s[a]--;
}
cout<<ans;
return 0;
}
| codeforces | 37 | 479 |
39704321 | 1000A | -1 | cpp | Accepted | 30 | 151,552 | #include<bits/stdc++.h>
const int N = 10;
const int M = 110;
char s[N];
int main(){
int n;
scanf("%d", &n);
std::map <std::string, int> Hash1, Hash2;
for (int i = 0; i < n; ++ i){
scanf("%s", s);
++ Hash1[s];
}
for (int i = 0; i < n; ++ i){
scanf("%s", s);
++ Hash2[s];
}
int ans = 0;
for (auto u : Hash2){
ans += std::min(u.second, Hash1[u.first]);
}
printf("%d\n", n - ans);
return 0;
}
| codeforces | 37 | 480 |
39704993 | 1000A | -1 | cpp | Accepted | 31 | 0 | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int n, a[2][10];
int main()
{
scanf("%d", &n);
for(int i=0; i<n*2; ++i)
{
char s[10];
scanf("%s", s);
if(s[0] == 'M')
++a[i>=n][0];
else
{
int len = strlen(s);
if(s[len-1] == 'S')
++a[i>=n][len];
else
++a[i>=n][len+4];
}
}
int sum = 0;
for(int i=0; i<9; ++i)
sum += min(a[0][i], a[1][i]);
printf("%d", n-sum);
return 0;
}
| codeforces | 37 | 480 |
39708815 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL n;
string s;
LL cnt[2][9];
map<string,LL>m;
int main(){
LL i,j;
string ts[]={"s","M","L","XS","XL","XXL","XXS","XXXL","XXXS"};
for(i=0;i<9;i++)m[ts[i]]=i;
cin>>n;
for(i=0;i<2;i++)for(j=0;j<n;j++){
cin>>s;
cnt[i][m[s]]++;
}
for(i=0;i<9;i++){
j=min(cnt[0][i],cnt[1][i]);
cnt[0][i]-=j;
cnt[1][i]-=j;
}
for(i=j=0;i<9;i++)j+=cnt[0][i];
cout<<j<<endl;
return 0;
} | codeforces | 37 | 480 |
39728897 | 1000A | -1 | cpp | Accepted | 30 | 16,384 | #include <bits/stdc++.h>
#define endl '\n'
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL)
using namespace std;
const int N = 1e6+10;
int main(){
FIO;
int n;
cin >> n;
map <string,int> m1,m2;
string s;
for(int i =0 ;i < n; ++i){
cin >> s;
m1[s]++;
}
for(int i =0 ;i < n; ++i){
cin >> s;
m2[s]++;
}
int ans = 0;
for(auto it : m2){
if(it.second > m1[it.first]){
ans += it.second - m1[it.first];
}
}
cout << ans;
} | codeforces | 37 | 480 |
39734467 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include<bits/stdc++.h>
using namespace std;
#define ll int
int main()
{
map<string, int > m1,m2;
ll n;
cin>>n;
for(int i=0;i<n;i++)
{
string s;
cin>>s;
m1[s]++;
}
for(int i=0;i<n;i++)
{
string s;
cin>>s;
m2[s]++;
}
int ans=0;
ans+=abs(m1["XS"]-m2["XS"]);
ans+=abs(m1["XXS"]-m2["XXS"]);
ans+=abs(m1["XXXS"]-m2["XXXS"]);
ans+=(abs(m1["M"]-m2["M"])+abs(m1["S"]-m2["S"])+abs(m1["L"]-m2["L"]))/2;
cout<<ans<<endl;
} | codeforces | 37 | 480 |
39741555 | 1000A | -1 | cpp | Accepted | 30 | 24,576 | #include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define pi 3.1415926
typedef long long ll;
int const maxn=1e3+5;
map<string,int>s;
int main()
{
string ss;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>ss;
s[ss]++;
}
int sum=0;
for(int i=0;i<n;i++)
{
cin>>ss;
if(s[ss])
{
sum++;
s[ss]--;
}
}
cout<<n-sum<<endl;
}
| codeforces | 37 | 480 |
39884701 | 1000A | -1 | cpp | Accepted | 31 | 307,200 | #include<bits/stdc++.h>
#define pb push_back
#define pf push_front
#define sz size()
using namespace std;
string a[111], b[111];
map <string , int> ma;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, e = 0;
cin >> n;
for(int i = 1 ; i <= n ; i++)
{
cin >> a[i];
ma[a[i]] ++;
}
for(int i = 1 ; i <= n ; i++)
{
cin >> b[i];
if(ma[b[i]] != 0)
{
ma[b[i]] --;
e++;
}
}
cout << n - e;
}
| codeforces | 37 | 480 |
76291432 | 1000A | -1 | cpp | Accepted | 31 | 24,576 | #include<bits/stdc++.h>
using namespace std;
const int maxn = 1e2+3, inf = 1e9, mod = 1e9+7;
long long n, ans;
string a[maxn], b[maxn];
map <string , int> str;
int main() {
ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
cin >> n;
for (int i = 0; i < n; i ++) {
cin >> a[i];
str[a[i]] ++;
}
for (int i = 0; i < n; i ++) {
cin >> b[i];
if (!str[b[i]]) ans ++;
else str[b[i]] --;
}
cout << ans << endl;
return 0;
}
| codeforces | 37 | 480 |
39704649 | 1000A | -1 | cpp | Accepted | 30 | 24,576 | #include<bits/stdc++.h>
using namespace std ;
vector<string> x , y;
int vis[101];
void run(){
int n ; scanf("%d" , &n);
x.resize(n);y.resize(n);
for(int i=0 ; i<n ;i++)cin >> x[i];
for(int i=0 ;i<n ;i++)cin >> y[i];
for(int i=0 ; i<n ; i++){
for(int i2=0 ; i2<n ; i2++){
if(x[i]==y[i2] && !vis[i2]){vis[i2]=1;break;}
}
}
int ans=0;
for(int i2=0 ; i2<n ; i2++)
if(!vis[i2])ans++;
cout << ans;
}
int main(){
run() ;
return 0 ;
} | codeforces | 37 | 481 |