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
|
---|---|---|---|---|---|---|---|---|---|---|
40506643 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
const int N=105;
string pre[N],cur[N];
int book[N];
int main()
{
// freopen("input.txt","r",stdin);
int n;
cin>>n;
rep(i,0,n)
cin>>pre[i];
rep(i,0,n)
cin>>cur[i];
int count=n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(cur[i]==pre[j]&&(!book[j])){
book[j]=1;
count--;
break;
}
}
}
cout<<count<<endl;
return 0;
} | codeforces | 37 | 446 |
53612161 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
main()
{
int n,i,ans=0;
scanf("%d",&n);
map<string,int>mp;
char s[10];
for(i=1;i<=n;i++)
{
scanf("%s",s);
mp[s]++;
}
for(i=1;i<=n;i++)
{
scanf("%s",s);
if(mp[s]==0)
{
ans++;
}
else
{
mp[s]--;
}
}
printf("%d",ans);
}
| codeforces | 37 | 446 |
62113524 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
int n, ans = 0;
cin >> n;
vector<string>A(n);
for (int i = 0; i < n; i++)
cin >> A[i];
for (int i = 0; i < n; i++)
{
string s;
bool a = false;
cin >> s;
for (int i = 0; i < A.size(); i++)
if (A[i] == s)
{
A.erase(A.begin() + i);
a = true;
break;
}
ans += !a;
}
cout << ans;
return 0;
} | codeforces | 37 | 446 |
39730962 | 1000A | -1 | cpp | Accepted | 31 | 28,672 | #include <bits/stdc++.h>
using namespace std;
int n,ans;
string a[110],b[110];
map<string,int> mpa,mpb;
string T[9]={"XXXL","XXL","XL","L","M","S","XS","XXS","XXXS"};
int main()
{
cin>>n;
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]]++;
for(int i=0;i<9;i++){
if(mpa[T[i]]<mpb[T[i]]) ans+=mpb[T[i]]-mpa[T[i]];
else ans+=mpa[T[i]]-mpb[T[i]];
}
cout<<ans/2<<endl;
return 0;
}
| codeforces | 37 | 447 |
39749073 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
map<string, int> mp;
string temp;
for(int i = 0; i < n; i++) {
cin >> temp;
mp[temp]++;
}
for(int i = 0; i < n; i++) {
cin >> temp;
mp[temp]--;
}
int ans = 0;
for(auto it : mp) {
if(it.second < 0) ans -= it.second;
}
cout << ans << endl;
}
| codeforces | 37 | 447 |
40213244 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include <bits/stdc++.h>
using namespace std;
vector<string>v;
map<string,int>m;
set<string>ss;
int main()
{
int n,x=0,y,z;
string s,s1,s2;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>s;
m[s]++;
}
for(int i=0;i<n;i++)
{
cin>>s;
v.push_back(s);
}
for(int i=0;i<n;i++)
{
if(m[v[i]])m[v[i]]--;
else x++;
}
cout<<x;
return 0;
}
| codeforces | 37 | 447 |
40934155 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include<iostream>
#include<cstdio>
#include<map>
#include<string>
using namespace std;
int main()
{
string a;
map<string,int> mp;
int ans=0;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a;
mp[a]++;
}
for(int i=0;i<n;i++)
{
cin>>a;
if(mp[a]>0)
{
mp[a]--;
}
else ans++;
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 447 |
77452302 | 1000A | -1 | cpp | Accepted | 61 | 40,960 | #include<bits/stdc++.h>
using namespace std;
map<string,int> test;
int main()
{
int n=0;
cin>>n;
string tempu;
for(int i=1;i<=n;i++)
{
cin>>tempu;
test[tempu]++;
}
for(int i=1;i<=n;i++)
{
cin>>tempu;
test[tempu]--;
}
long long int ans=0;
for(map<string,int>::iterator i=test.begin();i!=test.end();i++)
{
if(i->second<0)
ans+=abs(i->second);
}
cout<<ans<<endl;
}
| codeforces | 37 | 447 |
43478812 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <iostream>
#include <map>
#include <string>
using namespace std;
#define MAXN 110
map<string, int> m1, m2;
int n;
string t;
int main() {
cin >> n;
for (int i = 1; i <= n; ++i) cin >> t, ++m1[t];
for (int i = 1; i <= n; ++i) cin >> t, ++m2[t];
int cnt = 0;
for (map<string, int>::iterator it = m1.begin(); it != m1.end(); ++it)
cnt += min(it -> second, m2[it -> first]);
cout << n - cnt;
return 0;
} | codeforces | 37 | 447 |
47230573 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,count=0;
cin>>n;
int m=n;
int p=n;
vector<string> a(n),b(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<m;j++){
if(a[i]==b[j]){count++;
for (int k = j ; k < m-1 ; k++)
{b[k] = b[k+1]; }
m-=1; break; }
}
}
int ans=p-count;
cout<<ans;
return 0;
} | codeforces | 37 | 447 |
76700872 | 1000A | -1 | cpp | Accepted | 31 | 28,672 | #include<bits/stdc++.h>
using namespace std;
const int maxn = 500 + 29;
string t[maxn];
int main()
{
int n;
cin >> n;
string s;
int k = 0;
for(int i = 0; i < 2 * n; i++){
cin >> s;
t[i] = s;
}
for(int i = 0; i < n; i++){
for(int j = n; j < 2 * n; j++){
if(t[i] == t[j] && t[i] != " " && t[j] != " "){
t[i] = " ";
t[j] = " ";
{
k++;
break;
}
}
}
}
cout << n - k;
}
| codeforces | 37 | 447 |
76700872 | 1000A | -1 | cpp | Accepted | 31 | 28,672 | #include<bits/stdc++.h>
using namespace std;
const int maxn = 500 + 29;
string t[maxn];
int main()
{
int n;
cin >> n;
string s;
int k = 0;
for(int i = 0; i < 2 * n; i++){
cin >> s;
t[i] = s;
}
for(int i = 0; i < n; i++){
for(int j = n; j < 2 * n; j++){
if(t[i] == t[j] && t[i] != " " && t[j] != " "){
t[i] = " ";
t[j] = " ";
{
k++;
break;
}
}
}
}
cout << n - k;
}
| codeforces | 37 | 447 |
39707377 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
using namespace std;
int n;
map<string,int> a;
string s;
int main()
{
scanf("%d",&n);
for(int i=0;i<n;i++)
{
cin>>s;
a[s]++;
}
int num=0;
for(int i=0;i<n;i++)
{
cin>>s;
//cout<<s<<endl;
//cout<<a[s]<<endl;
if(a[s])
a[s]--;
//cout<<s<<endl;
// cout<<a[s]<<endl;
else if(!a[s])
num++;
}
printf("%d\n",num);
return 0;
}
| codeforces | 37 | 448 |
46292478 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
int counter=0;
cin>>n;
string old [n];
string now [n];
for(int i=0 ;i<n;i++){
cin>>old [i];
}
for(int j=0 ;j<n;j++){
cin>>now [j];
}
for(int i =0 ; i<n;i++){
for(int j=0;j<n;j++){
if( old[i]==now[j]){
counter++;
now[j]="kk";
break;}
}
}
cout<<n-counter;
}
| codeforces | 37 | 448 |
46292478 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
int counter=0;
cin>>n;
string old [n];
string now [n];
for(int i=0 ;i<n;i++){
cin>>old [i];
}
for(int j=0 ;j<n;j++){
cin>>now [j];
}
for(int i =0 ; i<n;i++){
for(int j=0;j<n;j++){
if( old[i]==now[j]){
counter++;
now[j]="kk";
break;}
}
}
cout<<n-counter;
}
| codeforces | 37 | 448 |
39705114 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <bits/stdc++.h>
#define pb push_back
typedef long long ll;
typedef long double ld;
using namespace std;
int n, ans;
string a[111], b[111];
int main(){
scanf("%d", &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[j] == b[i]){
a[j] = ""; b[i] = ""; ans++; break;
}
}
}
printf("%d\n", n - ans);
return 0;
} | codeforces | 37 | 449 |
39706786 | 1000A | -1 | cpp | Accepted | 30 | 155,648 | #include<bits/stdc++.h>
#define F first
#define S second
using namespace std;
map <string , int> a , b;
int main(){
// lanat be terafiiik :((
int n , ans(0);
string s;
cin >> n;
for(int i = 0 ; i < n ; i++){
cin >> s;
a[s]++;
}
for(int j = 0 ; j < n ; j++){
cin >> s;
b[s]++;
}
for(auto u : a)
ans += abs(u.S - b[u.F]);
for(auto u : b)
if(!a.count(u.F))
ans += u.S;
cout << ans/2 << endl;
return 0;
}
| codeforces | 37 | 449 |
39734304 | 1000A | -1 | cpp | Accepted | -1 | -1 | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
map<string,int>mp;
int n,i;
cin>>n;
string s[100],s1[100];
int count=0;
for(i=0;i<n;i++)
{
cin>>s[i];
mp[s[i]]++;
}
for(i=0;i<n;i++)
{
cin>>s1[i];
}
for(i=0;i<n;i++)
{
if(mp[s1[i]]>0)
mp[s1[i]]--;
else
count++;
}
cout<<count<<endl;
}
| codeforces | 38 | 449 |
39882095 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
map< string , int > mp;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
string s;
for(int i = 0; i < n; i++)
{
cin>>s;
mp[s] += 1;
}
int cnt = 0;
for(int i = 0; i < n; i++)
{
cin>>s;
if(mp[s] >= 1)
{
mp[s] -=1;
}
else
{
cnt++;
}
}
cout<<cnt<<endl;
return 0;
}
| codeforces | 37 | 449 |
39756600 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<map>
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int n, ans;
string s;
map<string, int>cnt;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> s;
cnt[s]--;
}
for (int i = 1; i <= n; i++) {
cin >> s;
cnt[s]++;
}
for (pair<string, int> p : cnt)
if (p.second > 0)ans += p.second;
printf("%d", ans);
} | codeforces | 37 | 449 |
39882095 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
map< string , int > mp;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
string s;
for(int i = 0; i < n; i++)
{
cin>>s;
mp[s] += 1;
}
int cnt = 0;
for(int i = 0; i < n; i++)
{
cin>>s;
if(mp[s] >= 1)
{
mp[s] -=1;
}
else
{
cnt++;
}
}
cout<<cnt<<endl;
return 0;
}
| codeforces | 37 | 449 |
40008341 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include<bits/stdc++.h>
#define endl '\n'
typedef long long int ll;
using namespace std;
int main(){
std::ios_base::sync_with_stdio(false);cin.tie(NULL);
int n;cin>>n;
map<string, int>a,b;string t;
for(int i=0; i<n; i++){
cin >> t;
a[t]++;
}
for(int i=0; i<n; i++){
cin>>t;
b[t]++;
}
int cc=n;
for(auto x:a){
cc-=min(x.second, b[x.first]);
}
cout<<cc<<endl;
}
| codeforces | 37 | 449 |
40521453 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include<iostream>
#include<string.h>
using namespace std;
string s[110],t[110];
int main(){
int j,n,i,ans=0;
cin>>n;
for(i=1;i<=n;i++) cin>>s[i];
for(i=1;i<=n;i++) cin>>t[i];
for(i=1;i<=n;i++){
int x=0;
for(j=1;j<=n;j++){
if(s[i]==t[j]){
t[j]="";
x=1;
break;
}
}
if(x==0) ans++;
}
cout<<ans<<endl;
return 0;
} | codeforces | 37 | 449 |
76466013 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<bits/stdc++.h>
using namespace std;
map<string,int>a,b;
string s[105],c;
int main()
{
int n;
scanf("%d",&n);
int i,sum=0;
for(i=1;i<=n;i++)
{
cin>>s[i];
a[s[i]]++;
}
for(i=1;i<=n;i++)
{
cin>>c;
if(a[c]!=0)
{
a[c]--;
}
else
{
sum++;
}
}
printf("%d\n",sum);
return 0;
}
| codeforces | 37 | 449 |
93547421 | 1000A | -1 | cpp | Accepted | 31 | 249,856 | #include <bits/stdc++.h>
using namespace std;
int main(){
map<char,int>cc[5];
int n;
cin>>n;
for(int i=0;i<n;i++){
string s;cin>>s;
cc[s.length()][s[s.length()-1]]++;
}
int ans=0;
for(int i=0;i<n;i++){
string s;cin>>s;
if(cc[s.length()][s[s.length()-1]]>0){
cc[s.length()][s[s.length()-1]]--;
}
else {
ans++;
}
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 449 |
39712539 | 1000A | -1 | cpp | Accepted | 30 | 20,480 | #include <bits/stdc++.h>
using namespace std;
#define loop(i,a,b) for(int i=a;i<b;i++)
string s1[101],s2[101];
int vis[101];
int main()
{
string str;
int n,cnt=0;
cin >> n;
loop(i,0,n)
cin >> s1[i];
loop(i,0,n)
cin >> s2[i];
int ans=0,fl=0;
loop(i,0,n)
{
fl=0;
loop(j,0,n)
{
if(s1[i]==s2[j])
{
//cout << vis[j] << " ";
if(!vis[j]) {fl=1,vis[j]=1;break;}
}
}
if(!fl) ans++;
}
cout << ans << "\n";
return 0;
} | codeforces | 37 | 450 |
50873518 | 1000A | -1 | cpp | Accepted | 31 | 147,456 | #include <bits/stdc++.h>
#define fl(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
int n;
cin >> n;
string a[n], b[n];
fl (i, 0, n) cin >> a[i];
fl (i, 0, n) cin >> b[i];
multiset <string> m;
fl (i, 0, n) m.insert(b[i]);
fl (i, 0, n) if (m.find(a[i]) != m.end()) m.erase(m.find(a[i]));
cout << m.size() << endl;
return 0;
}
| codeforces | 37 | 450 |
81332556 | 1000A | -1 | cpp | Accepted | 31 | 253,952 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, cambios=0;
string aux;
map<string, int> tallas;
cin>>n;
for(int i=0;i<n;i++){
cin>>aux;
tallas[aux]++;
}
for(int i=0;i<n;i++){
cin>>aux;
if(tallas[aux]>0){
tallas[aux]--;
}
else{
cambios++;
}
}
cout<<cambios<<endl;
return 0;
}
| codeforces | 37 | 450 |
39704571 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<iostream>
#include<cstdio>
using namespace std;
string s;
int n,i,k,j,a[4][3],ans;
int main()
{
cin>>n;
for(i=1;i<=n;i++)
{
cin>>s;
k=s.length()-1;
if(s[k]=='M') a[k][0]++;
else if(s[k]=='L') a[k][1]++;
else a[k][2]++;
}
for(i=1;i<=n;i++)
{
cin>>s;
k=s.length()-1;
if(s[k]=='M') j=0;
else if(s[k]=='L') j=1;
else j=2;
if(a[k][j]) a[k][j]--;
else ans++;
}
cout<<ans;
return 0;
}
| codeforces | 37 | 451 |
39790855 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<bits/stdc++.h>
#define IOS {ios :: sync_with_stdio(false); cin.tie(0); }
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
int main(){
ll n,i,j,k;
cin>>n;
string a[n],b[n];
for(i=0;i<n;i++) cin>>a[i];
for(i=0;i<n;i++) cin>>b[i];
ll cnt=0;
for(i=0;i<n;i++){
string s=b[i];
for(j=0;j<n;j++){
if(s==a[j]) {cnt++;
a[j]="";
break;
}
}
}
cout<<n-cnt;
}
| codeforces | 37 | 451 |
46741468 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define fr ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#include<algorithm>
#include<vector>
#include<string>
ll n; string s;
map<string, ll> m;
int main()
{
fr
cin>>n;
for(ll i=0;i<n;i++)
{
cin>>s;
m[s]++;
}
ll ans=0;
for(ll i=0;i<n;i++)
{
cin>>s;
if(m[s]) m[s]--;
else ans++;
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 451 |
52528901 | 1000A | -1 | cpp | Accepted | 31 | 24,576 | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <map>
#include <algorithm>
#include <iostream>
using namespace std;
map <string,int> mp;
int main(){
int T,count=0;
string s;
scanf("%d",&T);
for (int i=0;i<T;i++){
cin>>s;
mp[s]++;
}
for (int i=0;i<T;i++){
cin>>s;
if(mp[s]){
mp[s]--;
}
else{
count++;
}
}
printf("%d\n",count);
return 0;
}
/*
3
XS
XS
M
XL
S
XS
*/ | codeforces | 37 | 451 |
115470162 | 1000A | -1 | cpp | Accepted | 31 | 3,743,744 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;cin>>n;
string s;
vector<string>a;
for(int i=0;i<n;i++){
cin>>s;
a.push_back(s);
}
int cnt=0;
bool flag=true;
for(int j=0;j<n;j++){
cin>>s;
for(int i=0;i<a.size();i++){
if(s==a[i]){
a.erase(a.begin()+i);
break;}
}
}
// for(int i=0;i<a.size();i++)cout<<a[i]<<" ";
cout<<a.size()<<endl;
return 0;
} | codeforces | 37 | 451 |
39705076 | 1000A | -1 | cpp | Accepted | 31 | 0 | #include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
int n,m,k,va[105],vb[105],ans;
char a[105][5],b[105][5];
int main(){
scanf("%d",&n);
ans=n;
for(int i=1;i<=n;i++)
scanf("%s",a[i]);
for(int i=1;i<=n;i++)
scanf("%s",b[i]);
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(strcmp(a[i],b[j])==0&&!vb[j]){
vb[j]=1;
ans--;
break;
}
}
}
printf("%d\n",ans);
return 0;
}
| codeforces | 37 | 452 |
39706030 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n; cin>>n;
string a[n], b[n];
for(int i=0; i<n; i++) cin>>a[i];
for(int i=0; i<n; i++) cin>>b[i];
int vis[n]={0}; int cnt=0;
for(int i=0; i<n; i++){
bool fin=0;
for(int j=0; j<n; j++){
if (vis[j]==0 && a[i]==b[j]){
vis[j]=1;
fin=1;
break;
}
}
if (!fin) cnt++;
}
cout<<cnt;
} | codeforces | 37 | 452 |
39940785 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <iostream>
#include <bits/stdc++.h>
#define LL long long
#define Clear(a,x) memset(a,x,sizeof(a))
using namespace std;
const int MAXN = 105;
map<string, int> mp;
int main()
{
string s;
int n, ans = 0;
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] != 0) mp[s]--;
else ans++;
}
cout << ans << endl;
return 0;
}
| codeforces | 37 | 452 |
39940785 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <iostream>
#include <bits/stdc++.h>
#define LL long long
#define Clear(a,x) memset(a,x,sizeof(a))
using namespace std;
const int MAXN = 105;
map<string, int> mp;
int main()
{
string s;
int n, ans = 0;
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] != 0) mp[s]--;
else ans++;
}
cout << ans << endl;
return 0;
}
| codeforces | 37 | 452 |
41588611 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <map>
#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
string temp;
map<string,int> mm;
for(int i=0;i<n;i++)
{
cin>>temp;
mm[temp]++;
}
for(int i=0;i<n;i++)
{
cin>>temp;
mm[temp]--;
}
int counter=0;
for(auto it:mm)
{
if(it.second>0)
{
counter+=it.second;
}
}
cout<<counter<<endl;
return 0;
} | codeforces | 37 | 452 |
48181838 | 1000A | -1 | cpp | Accepted | 31 | 262,144 | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s, t;
vector<string>v, c;
for(int i = 0; i < n; i++){
cin >> s;
v.push_back(s);
}
for(int i = 0; i < n; i++){
cin >> t;
c.push_back(t);
}
int cnt = 0;
for(int i = 0; i < v.size(); i++){
for(int j = 0; j < c.size(); j++){
if(v[i] == c[j]){
auto it = c.begin() + j;
cnt++;
c.erase(it);
break;
}
}
}
cout << n - cnt << endl;
}
| codeforces | 37 | 452 |
58053375 | 1000A | -1 | cpp | Accepted | 31 | 20,721,664 | #include <bits/stdc++.h>
using namespace std;
long long i, j, n, c[223456],a[1111234], b[1125678],d[123456], l,ll,r, s, t, k,x, y,y1,z,m;
string p,q;
map <string , long long> mm;
int main() {
cin >>n;
for (i = 0; i < n; i ++){
cin >> p;
mm[p] ++;
}
for (i = 0; i <n; i ++){
cin >> p;
if (mm[p] == 0)
s ++;
else mm[p] --;
}
cout << s;
return 0;
} | codeforces | 37 | 452 |
72568621 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<iostream>
#include<string>
using namespace std;
int main( )
{
int n;
cin>>n;
string a[120],b[120];
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++)
{
int flag=1;
for(int j=0;j<n;j++)
{
if(a[i]==b[j])
{
flag=0;
b[j][0]='0';
a[i][0]='0';
break;
}
}
if(flag) ans++;
}
// cout<<ans<<endl;
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 452 |
39737496 | 1000A | -1 | cpp | Accepted | 30 | 16,384 | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{int n,cnt=0;
cin>>n;
char v[n][101],c[101];
for( int i=1; i<=n; i++)
cin>>v[i];
for ( int i=1; i<=n; i++)
{
cin>>c;
for( int j=1;j<=n; j++)
if(v[j][1]!='a')
if(strcmp(c,v[j])==0)
{
cnt++;
v[j][1]='a';
break;
}
}
cout<<n-cnt;
return 0;
}
| codeforces | 37 | 453 |
39707341 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main(){
int n,ans=0,i,j,k,flag[101];
char a[101][5],b[101][5];
cin>>n;
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
cin>>b[i];
for(i=0;i<n;i++)
flag[i]=0;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(strcmp(b[j],a[i])==0&&flag[j]==0){
flag[j]=1;
break;
}
}
if(j==n)
ans++;
}
cout<<ans;
}
| codeforces | 37 | 453 |
39707341 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main(){
int n,ans=0,i,j,k,flag[101];
char a[101][5],b[101][5];
cin>>n;
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
cin>>b[i];
for(i=0;i<n;i++)
flag[i]=0;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(strcmp(b[j],a[i])==0&&flag[j]==0){
flag[j]=1;
break;
}
}
if(j==n)
ans++;
}
cout<<ans;
}
| codeforces | 37 | 453 |
39737496 | 1000A | -1 | cpp | Accepted | 30 | 16,384 | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{int n,cnt=0;
cin>>n;
char v[n][101],c[101];
for( int i=1; i<=n; i++)
cin>>v[i];
for ( int i=1; i<=n; i++)
{
cin>>c;
for( int j=1;j<=n; j++)
if(v[j][1]!='a')
if(strcmp(c,v[j])==0)
{
cnt++;
v[j][1]='a';
break;
}
}
cout<<n-cnt;
return 0;
}
| codeforces | 37 | 453 |
39756696 | 1000A | -1 | cpp | Accepted | 31 | 1,748,992 | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
long long ans[MAXN];
vector < pair < long long, int > > p2;
int main() {
int n,i,j;
cin >> n;
multiset<string> s;
string s1;
for(i=0;i<n;i++)
{
cin>>s1;
s.insert(s1);
}
for(i=0;i<n;i++)
{
cin>>s1;
if(s.find(s1)!=s.end())
s.erase(s.find(s1));
}
cout <<s.size();
return 0;
}
| codeforces | 37 | 453 |
40398285 | 1000A | -1 | cpp | Accepted | 31 | 24,576 | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main()
{
int n;
string a;
multiset<string> pre;
while (cin >> n)
{
int res = 0;
for (int i = 0; i < n; i++)
{
cin >> a;
pre.insert(a);
}
for (int i = 0; i < n; i++)
{
cin >> a;
if (pre.count(a) == 0) res++;
else
{
multiset <string>::iterator pos = pre.find(a);
pre.erase(pos);
}
}
cout << res << endl;
}
return 0;
} | codeforces | 37 | 453 |
40536348 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include<iostream>
#include<cstring>
using namespace std;
int main(){
string str,b[9]={"XXXS","XXS","XS","S","M","L","XL","XXL","XXXL"};
long long n,s1,s2,sum;int i,j,a[10]={0};
cin>>n;
for(j=0;j<n;j++){
cin>>str;
for(i=0;i<9;i++){
if(str==b[i]){
a[i]++;
}
}
}
for(j=0;j<n;j++){
cin>>str;
for(i=0;i<9;i++){
if(str==b[i]){
a[i]--;
}
}
}
for(i=0,sum=0;i<=8;i++){
if(a[i]>0) sum+=a[i];
}
cout<<sum;
return 0;
} | codeforces | 37 | 453 |
39706077 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{ int n,c,k=0,i,j;
cin>>n;
string a[n],b[n];
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
cin>>b[i];
for(i=0;i<n;i++)
{ c=0;
for(j=0;j<n;j++)
if(a[i]==b[j])
{c=1;
b[j]=".";break;
}
if(c==0)
k++;
}
cout<<k;
return 0;
}
| codeforces | 37 | 454 |
39708379 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<stdio.h>
#include<string.h>
#include<iostream>
#include<map>
using namespace std;
map<string,int>L;
int main(){
string A,B;
int n,i,cnt=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
cin>>A;
L[A]++;
//printf("i=%d\n",i);
}
for(i=1;i<=n;i++){
cin>>A;
L[A]--;
}
map<string,int>::iterator it;
for(it=L.begin();it!=L.end();it++)
if(it->second>0)cnt+=it->second;
printf("%d",cnt);
return 0;
}
| codeforces | 37 | 454 |
39776112 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include <bits/stdc++.h>
#define ll long long int
#define FASTIO std::ios::sync_with_stdio(false);
#define pb push_back
#define mp make_pair
#define ld long double
#define F first
#define S second
using namespace std;
int main()
{
FASTIO
ll n;
cin>>n;
string s;
map <string,ll> ma;
for(ll i=0;i<n;i++)
{
cin>>s;
ma[s]++;
}
ll res=0;
for(ll i=0;i<n;i++)
{
cin>>s;
if(ma[s]>0)
{
res++;
ma[s]--;}
}
cout<<n-res;
} | codeforces | 37 | 454 |
40503980 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include<stdio.h>
#include<iostream>
#include<string.h>
#include<cmath>
#include<algorithm>
using namespace std;
#define ll long long
int main()
{
int n;
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];
}
int sum=0;
sort(a,a+n);sort(b,b+n);
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(a[i]==b[j])
{
sum++;
b[j]="0";
break;
}
}
}
cout<<n-sum;
return 0;
} | codeforces | 37 | 454 |
41154444 | 1000A | -1 | cpp | Accepted | 31 | 1,015,808 | #include <bits/stdc++.h>
using namespace std;
const int sz=1000;
char s[sz][sz],x[sz];
int main()
{
int i,j,n,a,b,ans=0;
scanf("%d", &n);
for(i=0;i<n;i++) scanf("%s", s[i]);
for(i=0;i<n;i++) {
scanf("%s", x);
for(j=0;j<n;j++) {
if(strcmp(s[j],x)==0) {
s[j][0]='0';
break;
}
}
if(j==n) ans++;
}
printf("%d\n", ans);
}
| codeforces | 37 | 454 |
51029175 | 1000A | -1 | cpp | Accepted | 31 | 24,576 | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
map<string, int> map_a;
string tmp;
cin >> n;
int res = 0;
for(int i = 0; i < n; i++){
cin >> tmp;
map_a[tmp]++;
}
for(int i = 0; i < n; i++){
cin >> tmp;
if(map_a[tmp] <= 0){
res ++;
}
else
map_a[tmp] --;
}
cout << res;
} | codeforces | 37 | 454 |
64788175 | 1000A | -1 | cpp | Accepted | 31 | 147,456 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i,res;
cin>>n;
vector<string>prev(n),curr(n);
for(i=0;i<n;i++)
cin>>prev[i];
for(i=0;i<n;i++)
cin>>curr[i];
map<string,int>a,b;
map<string,int>::iterator it;
for(i=0;i<n;i++)
{
a[prev[i]]++;
b[curr[i]]++;
}
res=n;
for(auto it=a.begin();it!=a.end();it++)
res-=min(it->second,b[it->first]);
cout<<res;
return 0;
}
| codeforces | 37 | 454 |
39708582 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<bits/stdc++.h>
using namespace std;
int main()
{
map<string,int>mp;
vector<string>vec1,vec2;
int n,ans = 0;
cin>>n;
string x;
for(int i = 0; i<n; i++)
{
cin>>x;
vec1.push_back(x);
mp[x]++;
}
for(int i = 0; i<n; i++)
{
cin>>x;
{
if(mp[x]>0) {ans++;
mp[x]--;
}
}
}
cout<<n - ans<<endl;
}
| codeforces | 37 | 455 |
39711238 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
int n,c=0;
cin>>n;
string a[n];
string b[n];
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<n;i++)
cin>>b[i];
int flag=0;
for(int i=0;i<n;i++)
{flag=0;
for(int j=0;j<n;j++){
if(a[i]==b[j]){
b[j]="**";
flag=1;
break;
//cout<<a[i]<<endl;}
}
}
if(flag==0)
c++;
}
cout<<c;
} | codeforces | 37 | 455 |
39757774 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
map<string,int>cnta,cntb;
string s;
for(int i=0;i<n;i++)
{
cin>>s;
++cnta[s];
}
for(int i=0;i<n;i++)
{
cin>>s;
++cntb[s];
}
int count=n;
for(auto it:cnta)
{
count=count-min(it.second,cntb[it.first]);
}
cout<<count<<endl;
} | codeforces | 37 | 455 |
40374353 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int count=0,time=0;
string s[2*n];
for(int i=0;i<2*n;i++){
cin>>s[i];
}
for(int i=0;i<n;i++){
for(int j=n;j<2*n;j++){
if(s[i]==s[j])
{
s[j]='0';
break;
}
if(j==2*n-1)
time++;
}
}
cout<<time;
return 0;
}
| codeforces | 37 | 455 |
65827386 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN=1e5+10;
map<string,int>mp;
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
string s;
cin>>s;
if(mp[s]==0)mp[s]=1;
else mp[s]++;
}
int ans=0;
for(int i=0;i<n;i++){
string s;
cin>>s;
if(mp[s]==0)ans++;
else mp[s]--;
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 455 |
74601240 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int a[9]={0},b[9]={0},i,k,gs=0;
string s;
for(i=0;i<2*n;i++){
cin>>s;
if(s[s.length()-1]=='S')
k=1;
else if(s[s.length()-1]=='L')
k=2;
else
k=0;
if(i<n){
a[2*(s.length()-1)+k]++;
}
else
b[2*(s.length()-1)+k]++;
}
for(i=0;i<9;i++)
gs+= abs(a[i]-b[i]);
cout<<gs/2;
return 0;
}
| codeforces | 37 | 455 |
78087459 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<bits/stdc++.h>
#define reg register
#define int long long
using namespace std;
int n,ans;
string stra[105],strb[105];
map<string,int> t;
signed main(){
scanf("%d",&n);
for(reg int $=1;$<=n;$++){
cin>>stra[$];
t[stra[$]]++;
}
for(reg int $=1;$<=n;$++){
cin>>strb[$];
t[strb[$]]--;
}
for(reg int $=1;$<=n;$++)
if(t[stra[$]]>0){
ans+=t[stra[$]];
t[stra[$]]=0;
}
printf("%d\n",ans);
return 0;
}
| codeforces | 37 | 455 |
88274836 | 1000A | -1 | cpp | Accepted | 31 | 3,743,744 | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
int main()
{
ll n;
cin>>n;
string s1[n];
string s2[n];
map<string,ll>mp;
for(ll i=0;i<n;i++)
{
cin>>s1[i];
mp[s1[i]]++;
}
ll cnt=0;
for(ll i=0;i<n;i++)
{
cin>>s2[i];
if(mp[s2[i]]>=1)
{
cnt++;
mp[s2[i]]--;
}
}
cout<<n-cnt<<endl;
}
| codeforces | 37 | 455 |
39723117 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<string> A, B;
vector<string>::iterator it;
int n;
string tmp;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> tmp;
A.push_back(tmp);
}
for (int i = 0; i < n; i++)
{
cin >> tmp;
it = find(A.begin(), A.end(), tmp);
if (it != A.end())
A.erase(it);
}
cout << A.size();
return 0;
}
| codeforces | 37 | 456 |
39712957 | 1000A | -1 | cpp | Accepted | 30 | 12,288 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int compare(string s1,string s2)
{
return s1.length()<s2.length();
}
map<string,int>m,m1;
int main()
{
ll n;
cin>>n;
string s[n];
for(int i = 0;i<n;i++)
{
cin>>s[i];
m[s[i]]++;
}
string s1[n];
int ans=0;
for(int i =0;i<n;i++)
{
cin>>s1[i];
if(m[s1[i]])
{
m[s1[i]]--;
}
else ans++;
}
cout<<ans;
return 0;
}
| codeforces | 37 | 456 |
39723117 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<string> A, B;
vector<string>::iterator it;
int n;
string tmp;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> tmp;
A.push_back(tmp);
}
for (int i = 0; i < n; i++)
{
cin >> tmp;
it = find(A.begin(), A.end(), tmp);
if (it != A.end())
A.erase(it);
}
cout << A.size();
return 0;
}
| codeforces | 37 | 456 |
39771767 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
map <string,int> m;
int main()
{
int n;
cin >> n;
string s;
int count = 0;
for(int i=0;i<n;i++)
{
cin >> s;
m[s]++;
}
for(int i=0;i<n;i++)
{
cin >> s;
if(m[s] == 0)
count++;
else
m[s]--;
}
cout << count << endl;
} | codeforces | 37 | 456 |
41219473 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <memory>
using namespace std;
int main() {
int n;
cin >> n;
map<string, int> ts;
string t;
for (int i = 0; i < n; ++i) {
cin >> t;
++ts[t];
}
int ans = 0;
for (int i = 0; i < n; ++i) {
cin >> t;
if (ts.find(t) != ts.end() && ts[t] > 0) {
ts[t]--;
} else {
++ans;
}
}
cout << ans << "\n";
return 0;
} | codeforces | 37 | 456 |
66487523 | 1000A | -1 | cpp | Accepted | 31 | 0 | #include<cstdio>
#include<cstring>
char s[10];
int t[10][26];
int main(void)
{
int n;
scanf("%d",&n);
for(int i=1; i<=n; ++i)
{
scanf("%s",s+1);
int l=strlen(s+1), c=s[l]-'A';
++t[l][c];
}
for(int i=1; i<=n; ++i)
{
scanf("%s",s+1);
int l=strlen(s+1), c=s[l]-'A';
--t[l][c];
}
int ans=0;
for(int i=1; i<=4; ++i)
for(int j=0; j<26; ++j)
if(t[i][j]>0) ans+=t[i][j];
printf("%d",ans);
return 0;
}
| codeforces | 37 | 456 |
105169696 | 1000A | -1 | cpp | Accepted | 15 | 12,288 | #include <bits/stdc++.h>
#define int long long
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
signed main(){
fastio
map<string,int> a,b;
int n;
cin >> n;
for(int i = 0;i < n;i++){
string tmp;
cin >> tmp;
a[tmp]++;
}
for(int i = 0;i < n;i++){
string tmp;
cin >> tmp;
b[tmp]++;
}
int ans = n;
for(auto [x,y] : a){
ans -= min(y,b[x]);
}
cout << ans << "\n";
} | codeforces | 37 | 456 |
39710031 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
map<string,int> occ;
int main(){
int n,ans=0;
cin >> n;
string a[n],b[n];
for(int i=0;i<n;i++)
cin >> a[i];
for(int i=0;i<n;i++)
cin >> b[i],occ[b[i]]++;
for(int i=0;i<n;i++){
if (occ.count(a[i]) && occ[a[i]]>0)
occ[a[i]]--;
else
ans++;
}
cout << ans;
}
| codeforces | 37 | 457 |
40154309 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#include<algorithm>
using namespace std;
map<string,int>m;
string s;
int n,ans=0;
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
cin>>s;
m[s]++;
}
for(int i=1;i<=n;i++)
{
cin>>s;
m[s]--;
}
for(map<string,int>::iterator it=m.begin();it!=m.end();it++)
ans+=max(0,it->second);
cout<<ans<<endl;
return 0;
} | codeforces | 37 | 457 |
51109360 | 1000A | -1 | cpp | Accepted | 30 | 24,576 | #include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int n, ans;
string a[maxn], b[maxn];
int main() {
scanf("%d", &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]) {
++ans;
b[j] = "";
break;
}
}
printf("%d\n", n - ans);
}
| codeforces | 37 | 457 |
51109360 | 1000A | -1 | cpp | Accepted | 30 | 24,576 | #include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int n, ans;
string a[maxn], b[maxn];
int main() {
scanf("%d", &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]) {
++ans;
b[j] = "";
break;
}
}
printf("%d\n", n - ans);
}
| codeforces | 37 | 457 |
67160506 | 1000A | -1 | cpp | Accepted | 46 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int n,sum;
map <string,int> s;
string a;
int main() {
ios_base::sync_with_stdio(false);cin.tie(NULL);
//freopen("hihi.txt","r",stdin);
cin>>n;
for(int i=0;i<n;i++){
cin>>a;
s[a]++;
}
for(int i=0;i<n;i++){
cin>>a;
if(s[a]>0)
s[a]--;
}
for(auto x:s){
sum+= x.second;
}
cout<<sum;
return 0;
} | codeforces | 37 | 457 |
112315990 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | //
// Created by zrz on 2021/4/8.
//
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
int n,ans;
map<string,int> m;
int main(){
cin >> n;
for (int i = 0;i < n;i ++) {
string s;
cin >> s;
m[s] ++;
}
for (int i = 0;i < n;i ++) {
string s;
cin >> s;
if (m[s] == 0) ans ++;
else m[s] --;
}
cout << ans;
}
| codeforces | 37 | 457 |
39718934 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
string s[101], c[101];
cin >> n;
for (int i = 0; i < n; i++)
cin >> s[i];
for (int i = 0; i < n; i++)
cin >> c[i];
int cnt = 0, len, flag = 0;
for (int i = 0; i < n; i++){
len = s[i].size();
flag = 0;
for (int j = 0; j < n; j++){
if (s[i] == c[j]){
c[j] = "Wasted";
flag = 1;
break;
}
}
if (flag != 1){
cnt++;
}
}
cout << cnt << endl;
}
| codeforces | 37 | 458 |
39891175 | 1000A | -1 | cpp | Accepted | 31 | 335,872 | #include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int cnt = 0;
int n;
string first[200],second[200];
int main()
{
scanf("%d",&n);
for (int i = 0 ; i < n ; i ++)
{
cin>>first[i];
}
for (int i = 0 ; i < n ; i ++)
{
cin>>second[i];
cnt ++;
for (int j = 0 ; j < n ; j ++)
{
if(first[j] == second[i])
{
first[j] = "1";
cnt --;
break;
}
}
}
cout<<cnt<<endl;
}
| codeforces | 37 | 458 |
40864596 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include "iostream"
#include "string"
#include "map"
using namespace std;
map<string,int> mp1,mp2;
int main()
{
int n,ans=0;
string s[105];
string str;
cin>>n;
for(int i=1;i<=n;i++) {cin>>s[i];mp1[s[i]]++;}
for(int i=1;i<=n;i++) {
cin>>str;
if(!mp1[str]) ans++;
else mp2[str]++;
}
for(int i=1;i<=n;i++) if(mp2[s[i]]-mp1[s[i]]>0) ans+=mp2[s[i]]-mp1[s[i]],mp2[s[i]]=0;
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 458 |
51237469 | 1000A | -1 | cpp | Accepted | 30 | 811,008 | //*******Maruf_____IIT__BHU_Rev2021 ?*******
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int arr[100005];
int arr2[100005];
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
map<string,int> mp;
string s;
int n;
cin>>n;
int k = n;
while(n--)
{
cin>>s;
mp[s]++;
}
int ans = 0;
while(k--)
{
cin>>s;
if(mp[s]>0)
mp[s]--;
else ans++;
}
cout<<ans<<'\n';
}
| codeforces | 37 | 458 |
62842321 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<map>
using namespace std;
//cfA题,憨憨敬礼了啊
//缺少的是提炼问题,简化问题的能力
//还缺少一点,map我日你妈怎么用啊啊啊啊
map<string,int> mp;
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
string s;
cin>>s;
mp[s]++;
}
int ans=0;
for(int i=1;i<=n;i++){
string s;
cin>>s;
if(mp[s]){
mp[s]--;
continue;
}
ans++;
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 458 |
112053850 | 1000A | -1 | cpp | Accepted | 31 | 155,648 | #include <iostream>
#include<map>
#include<string>
using namespace std;
int main(int argc, char** argv) {
int n,count=0;
string s;
map<int ,string> mapstu;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>s;
mapstu[i]=s;
}
for(int i=0;i<n;i++)
{
int k=0;
cin>>s;
for(int j=0;j<n;j++)
{
if(s==mapstu[j])
{
mapstu[j]="ss";
k=1;
break;
}
}
if(k==0)
{
count++;
}
}
cout<<count<<endl;
}
| codeforces | 37 | 458 |
51453093 | 1000A | -1 | cpp | Accepted | 31 | 155,648 | #include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
int main() {
int n;
cin >> n;
vector<string> a(n), b(n);
forn(i, n) cin >> a[i];
forn(i, n) cin >> b[i];
map<string, int> cnta, cntb;
forn(i, n) ++cnta[a[i]];
forn(i, n) ++cntb[b[i]];
int ans = n;
for (auto it : cnta) ans -= min(it.second, cntb[it.first]);
cout << ans << endl;
return 0;
} | codeforces | 37 | 459 |
39707894 | 1000A | -1 | cpp | Accepted | 30 | 20,480 | #include<bits/stdc++.h>
using namespace std;
int used1[101],used2[101];
int main () {
int n;
cin>>n;
string a[n+1],b[n+1];
for ( int i=1; i<=2*n; i++) {
if (i<=n) cin>>a[i];
else cin>>b[i-n];
}
int cnt=0;
for ( int i=1; i<=n; i++)
for (int j=1; j<=n; j++)
if ((used1[i]==0) && (used2[j]==0))
if (a[i]==b[j]) {
cnt++;
used1[i]=1;
used2[j]=1;
}
cout<<n-cnt;
return 0;
}
| codeforces | 37 | 459 |
39707894 | 1000A | -1 | cpp | Accepted | 30 | 20,480 | #include<bits/stdc++.h>
using namespace std;
int used1[101],used2[101];
int main () {
int n;
cin>>n;
string a[n+1],b[n+1];
for ( int i=1; i<=2*n; i++) {
if (i<=n) cin>>a[i];
else cin>>b[i-n];
}
int cnt=0;
for ( int i=1; i<=n; i++)
for (int j=1; j<=n; j++)
if ((used1[i]==0) && (used2[j]==0))
if (a[i]==b[j]) {
cnt++;
used1[i]=1;
used2[j]=1;
}
cout<<n-cnt;
return 0;
}
| codeforces | 37 | 459 |
39722868 | 1000A | -1 | cpp | Accepted | 30 | 12,288 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t,i,j,k,l,m,n,count;
string s[205],s1[205];
map<string,int>mp;
scanf("%d",&n);
count=0;
for(i=0;i<n;i++)
{
cin>>s[i];
mp[s[i]]++;
}
for(i=0;i<n;i++)
{
cin>>s1[i];
if(mp[s1[i]]>0)
{
mp[s1[i]]--;
}
else
count++;
}
printf("%d",count);
return 0;
} | codeforces | 37 | 459 |
39752519 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include <bits/stdc++.h>
#define F first
#define S second
#define ll long long
#define ld long double
#define pb push_back
#define sz size
using namespace std;
const int N=1e5+9;
map<string,int> a,b;
int n,ans;
string s;
int main(){
cin>>n;
for(int i=0;i<n;i++){cin>>s;a[s]++;}
for(int i=0;i<n;i++){
cin>>s;
b[s]++;
if(a[s]!=0){a[s]--;b[s]--;}
}
for(auto x:b){ans+=abs(x.S);}
cout<<ans<<endl;
}
/**
2
R23C55
BC23
**/
| codeforces | 37 | 459 |
39891860 | 1000A | -1 | cpp | Accepted | 31 | 446,464 | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n ;
cin >> n;
int rep;
string temp;
multiset<string> data;
for(int i=0 ; i < n ; i++){
cin >> temp;
data.insert(temp);
}
for(int i=0 ; i < n ; i++){
cin >> temp;
multiset<string>::iterator hit(data.find(temp));
if (hit!= data.end()) data.erase(hit);
}
cout << data.size();
return 0;
}
| codeforces | 37 | 459 |
41656000 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
map<string, int> siz;
map<int, int> sol;
string pom = "";
for(int i = 0; i < n; i++){
cin >> pom;
siz[pom]++;
}
for(int i = 0; i < n; i++){
cin >> pom;
siz[pom]--;
}
int ans = 0;
for(auto const& x : siz) if(x.second != 0) sol[x.first.length()] += abs(x.second);
for(auto const& x : sol) ans += x.second;
cout << ans / 2;
} | codeforces | 37 | 459 |
39733635 | 1000A | -1 | cpp | Accepted | 15 | 12,288 | #include<iostream>
#include<map>
using namespace std;
int main()
{
map<string,int> first;
string arr[9]={"M","S","L","XL","XS","XXS","XXL","XXXS","XXXL"},str;
int val[9]={0};
int count=0,i,n
;
for(i=0;i<9;i++)
{
first[arr[i]]=val[i];
}
cin>>n;
for(i=0;i<n;i++)
{
cin>>str;
first[str]++;
}
for(i=0;i<n;i++)
{
cin>>str;
first[str]--;
}
for(i=0;i<9;i++)
{
if(first[arr[i]]<0)
count=count+(-first[arr[i]]);
}
cout<<count;
} | codeforces | 37 | 460 |
39750645 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <iostream>
#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
map<string,int>last;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie();
int n,ans=0;
string cur;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>cur;
last[cur]++;
}
for(int i=0;i<n;i++)
{
cin>>cur;
if (last[cur])last[cur]--;
else ans++;
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 460 |
40613417 | 1000A | -1 | cpp | Accepted | 31 | 53,248 | #include<bits/stdc++.h>
using namespace std;
int j,k,n,c;
string s1[1000],s2[1000];
int main()
{
cin>>n;
for(int i=0;i<n;i++)
cin>>s1[i];
for(int i=0;i<n;i++)
cin>>s2[i];
sort(s1,s1+n);
sort(s2,s2+n);
while(j<n&&k<n)
{
while(s1[j]==s2[k]&&k<n&&j<n)
{
j++;
k++;
}
while(s1[j]<s2[k]&&j<n)
{
j++;
c++;
}
while(s1[j]>s2[k]&&k<n)
{
k++;
c++;
}
}
c+=n-k+n-j;
cout<<c/2;
return 0;
} | codeforces | 37 | 460 |
39705669 | 1000A | -1 | cpp | Accepted | 31 | 45,056 | #include <bits/stdc++.h>
using namespace std;
int a[10][300], b[10][300];
int main () {
int n; scanf("%d", &n);
for (int i = 0; i < n; ++i) {
string s; cin >> s;
++a[int(s.size())][s[int(s.size()) - 1]];
}
for (int i = 0; i < n; ++i) {
string s; cin >> s;
++b[int(s.size())][s[int(s.size()) - 1]];
}
int ans = 0;
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 300; ++j)
ans += max(0, b[i][j] - a[i][j]);
return printf("%d\n", ans), 0;
} | codeforces | 37 | 461 |
39712647 | 1000A | -1 | cpp | Accepted | 30 | 12,288 | #include<iostream>
#include<string>
#include<map>
#include<algorithm>
using namespace std;
int main()
{
int n;
int i,j;
cin>>n;
int count=0;
map<string,int>m,m1;
string s[n],s1[n];
for(i=0;i<n;i++)
{
cin>>s[i];
m[s[i]]++;
}
int n1=m.size();
for(i=0;i<n;i++)
{
cin>>s1[i];
m[s1[i]]--;
}
map <string,int>::iterator it;
for(it=m.begin();it!=m.end();it++)
if((*it).second>0)
count+=it->second;
cout<<count;
}
| codeforces | 37 | 461 |
39725590 | 1000A | -1 | cpp | Accepted | 31 | 2,822,144 | #include <bits/stdc++.h>
using namespace std;
int n;
set<int> s;
string a[100010];
int bio[100010];
string b;
int main () {
cin >> n;
for (int i = 0; i < n; i ++) {
cin >> a[i];
}
int sol = 0;
for (int i = 0; i <n; i ++) {
cin >> b;
int da = 1;
for (int j = 0; j < n; j ++) {
if (bio[j] == 0 && b == a[j]) {
bio[j] = 1;
da = 0;
break;
}
}
sol += da;
}
cout << sol;
return 0;
}
| codeforces | 37 | 461 |
39751424 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include<bits/stdc++.h>
using namespace std;
int main()
{
map<string,int>ma;
map<string,int>mb;
int n;
cin >> n;
for(int i=0; i<n; i++)
{
string s;
cin >> s;
ma[s]++;
}
int cnt = 0;
for(int i=0; i<n; i++)
{
string s;
cin >> s;
if(ma[s]>0)
{
ma[s]--;
}
else {mb[s]++;cnt++;}
}
cout << cnt << endl;
} | codeforces | 37 | 461 |
39759375 | 1000A | -1 | cpp | Accepted | 31 | 3,379,200 | #include <bits/stdc++.h>
#define lol long long
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
unordered_map<string,lol> x;
lol T;
string s;
cin >> T;
for(lol i=0; i<T; i++){
cin >> s;
x[s]++;
}
lol ans=0;
for(lol i=0; i<T; i++){
cin >> s;
x[s]--;
if(x[s]<0) ans++;
}
cout << ans;
return 0;
} | codeforces | 37 | 461 |
39764218 | 1000A | -1 | cpp | Accepted | 31 | 3,375,104 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int main()
{
map <string,ll> m;
ll n;cin>>n;
for(ll i=0;i<n;i++)
{
string str;
cin>>str;
m[str]++;
}
ll ct=0;
for(ll i=0;i<n;i++)
{
string str;
cin>>str;
m[str]--;
if(m[str]<0)
ct++;
}
cout<<ct;
} | codeforces | 37 | 461 |
39867515 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <iostream>
using namespace std;
int main()
{
int num,ans=0; int exist=1,exist2=0;
cin>>num;
string cur[num],prev[num];
for (int i=0;i<num;i++) cin>>cur[i];
for (int i=0;i<num;i++) cin>>prev[i];
for (int i=0;i<num;i++)
{
for (int x=0;x<num;x++)
{
if (cur[i]==prev[x]) { prev[x]=" "; break;}
if (x==num-1) ans++;
}
}
cout<<ans;
return 0;
}
| codeforces | 37 | 461 |
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 |