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
|
---|---|---|---|---|---|---|---|---|---|---|
39709218 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
map<string,int> a;
set<string> s;
for(int i=0;i<n;i++)
{
string str;
cin>>str;
a[str]++;
s.insert(str);
}
map<string,int> b;
for(int i=0;i<n;i++)
{
string str;
cin>>str;
b[str]++;
s.insert(str);
}
int ans = 0;
for(set<string>::iterator itr = s.begin();itr != s.end();itr++)
{
ans += abs(a[(*itr)] - b[(*itr)]);
}
cout<<ans/2<<endl;
return 0;
} | codeforces | 37 | 481 |
39713440 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<algorithm>
using namespace std;
int num1[10];
int main(){
int n;
cin>>n;
map<string,int>num1;
string s;
for(int i=1;i<=n;++i)
{
cin>>s;
num1[s]++;
}
for(int i=1;i<=n;++i)
{
cin>>s;
num1[s]--;
}
int sum=0;
for(auto pi=num1.begin();pi!=num1.end();++pi)
{
if(pi->second<0)
sum-=pi->second;
}
cout<<sum<<endl;
return 0;
}
| codeforces | 37 | 481 |
39729661 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
int n,sum;
char a[101][5],b[101][5];
cin>>n;
sum=n;
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<n;i++)
{
cin>>b[i];
for(int j=0;j<n;j++)
if(!strcmp(a[j],b[i]))
{
sum--;
a[j][0]='@';
b[i][0]='#';
}
}
cout<<sum<<endl;
return 0;
}
| codeforces | 37 | 481 |
39809354 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<iostream>
#include<bits/stdc++.h>
#include <stdio.h>
#define sort(v) sort(v.begin(),v.end())
#define fr(i,x,n) for(int i=x;i<n;i++)
using namespace std;
void Doaa()
{
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
int main(){
Doaa();
int n,ans=0;
cin>>n;
vector<string> v(n),v1(n);
fr(i,0,n)
cin>>v[i];
fr(i,0,n)
cin>>v1[i];
fr(i,0,n)
fr(j,0,n)
if(v[i]==v1[j])
{
ans++;
v1[j]=".";
break;
}
cout<<n-ans<<endl;
return 0;
}
| codeforces | 37 | 481 |
68156164 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #import<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,f,i,n,u,v,w,x,y,z;
string s;
main()
{
for(cin>>n;i++<n;)
{
cin>>s;
if(s=="XXXL")a++;
if(s=="XXL")b++;
if(s=="XL")c++;
if(s=="L")d++;
if(s=="M")e++;
if(s=="S")f++;
}
for(i=0;i++<n;)
{
cin>>s;
if(s=="XXXL")u++;
if(s=="XXL")v++;
if(s=="XL")w++;
if(s=="L")x++;
if(s=="M")y++;
if(s=="S")z++;
}
cout<<abs(a-u)+abs(b-v)+abs(c-w)+max(abs(d-x),max(abs(e-y),abs(f-z)));
} | codeforces | 37 | 481 |
76620872 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<iostream>
#include<map>
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
string a[101];
int main()
{
int n,ans;
cin >> n;
ans=n;
map<string,int>visa,visb;
for(int i=0;i<n;i++)
cin >> a[i],visa[a[i]]++;
for(int i=0;i<n;i++)
{
string b;
cin >> b;
if(visa[b]!=0)
{
ans--;
visa[b]--;
}
}
cout << ans << endl;
}
| codeforces | 37 | 481 |
99066537 | 1000A | -1 | cpp | Accepted | 31 | 557,056 | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N];
int main(){
int n,ans=0;
cin>>n;
map<string,int>ma,ma1;
for(int i=0;i<n;i++)
{
string str;
cin>>str;
ma[str]++;
}
for(int i=0;i<n;i++)
{
string str;
cin>>str;
ma1[str]++;
}
for(auto it:ma1)
ans+=min(it.second,ma[it.first]);
cout<<n-ans<<endl;
return 0;
}
| codeforces | 37 | 481 |
123063773 | 1000A | -1 | cpp | Accepted | 31 | 3,907,584 | #include<iostream>
using namespace std;
int main()
{
string a[105];
string b[105];
int n;
cin>>n;
int y=0;
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++)
{
int f=0;
for(int j=1;j<=n;j++)
{
if(a[j]!="k"&&b[i]!="k")
{
if(a[j]==b[i])
{
f=1;
a[j]="k";
b[i]="k";
y++;
break;
}
}
}
if(f==1) continue;
}
cout<<n-y<<endl;
return 0;
}
| codeforces | 37 | 481 |
40781261 | 1000A | -1 | cpp | Accepted | 15 | 8,192 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
vector<string> a, b, c;
string x;
int ans = 0;
int main() {
ios_base::sync_with_stdio(false),cin.tie(0),cout.precision(17);
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);
for(int i = 0;i < n;i++)
if(find(a.begin(), a.end(), b[i]) != a.end())
a.erase(find(a.begin(), a.end(), b[i]));
cout << a.size() << endl;
return 0;
} | codeforces | 37 | 482 |
57064504 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
map<string,int> mp;
int n;
string s;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>s;
mp[s]++;
}
int ans=0;
for(int i=1;i<=n;i++)
{
cin>>s;
mp[s]--;
}
for(auto i:mp)
{
if(i.second<0) ans-=i.second;
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 482 |
67654919 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include<bits/stdc++.h>
using namespace std;
#define Jewel ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
multiset<string> st;
int main()
{
Jewel;
int n, i;
string s;
cin>>n;
for(i=0; i<n; i++)
{
cin>>s;
st.insert(s);
}
for(i=0; i<n; i++)
{
cin>>s;
auto it = st.find(s);
if(it != st.end())
st.erase(it);
}
cout<<st.size()<<endl;
return 0;
}
| codeforces | 37 | 482 |
39704858 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int main()
{
int total,i,c=0;
scanf("%d",&total);
string str;
map<string,int> mp;
for(i=0;i<total;i++)
{
cin>>str;
if(mp[str])
mp[str]++;
else
mp[str]=1;
}
for(i=0;i<total;i++)
{
cin>>str;
if(mp[str])
mp[str]--;
else
c++;
}
printf("%d\n",c);
return 0;
}
| codeforces | 37 | 483 |
39706039 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
using namespace std;
const int maxn=1e2+10;
map<string,int>s;
char str[100],str1[maxn];
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%s",str);
s[str]++;
}
while(n--){
scanf("%s",str1);
if(s[str1]>0)
s[str1]--;
}
int ans=0;
map<string,int>::iterator it;
for(it=s.begin();it!=s.end();it++){
ans+=it->second;
}
printf("%d\n",ans);
return 0;
}
| codeforces | 37 | 483 |
39714040 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s[105]; string s1[105];int n, c = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s[i];
}
for (int i = 0; i < n; i++) {
cin >> s1[i];
}
for (int i = 0; i < n; i++) {
bool g = 0 ;
for (int j=0 ;j<n;j++){
if (s1[i] == s[j] ){
s[j] = "00" ;
g = 1 ;
break ;
}
}
if (!g)++c;
}
cout << c;
return 0;
} | codeforces | 37 | 483 |
39737141 | 1000A | -1 | cpp | Accepted | 30 | 20,480 | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define maxn 10010
#define INF 0x3f3f3f3f
#define mod 1000000007
int main() {
//freopen("test.in","r",stdin);
map<string,int> q;
int n,ans=0;
string s;
cin>>n;
for(int i=1;i<=n;i++) cin>>s,q[s]++;
for(int i=1;i<=n;i++) cin>>s,q[s]=q[s]==0?0:q[s]-1;
for(map<string,int>::iterator it=q.begin();it!=q.end();++it){
if(it->second!=0) ans+=it->second;
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 483 |
39790629 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, q=0;
cin >> a;
vector<string> x(a), y(a);
for (int i = 0; i < a; i++) {
string temp1;
cin >> temp1;
x[i]=temp1;}
for (int i = 0; i < a; i++) {
string temp1, temp2;
cin >> temp1;
y[i]=temp1;}
for (int i = 0; i < a; i++) {
for (int j = 0; j < a; j++) {
if ((x[i]==y[j])&&(x[i]!="0")){q=q+1;
x[i]="0";
y[j] = "0";}
}}
cout << a-q;
return 0;
} | codeforces | 37 | 483 |
39822897 | 1000A | -1 | cpp | Accepted | 31 | 163,840 | #include<iostream>
#include<set>
#include<string>
std::string a[200], b[200];
std::multiset<std::string > st;
int main() {
int n;
std::cin >> n;
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
for (int i = 0; i < n; i++) {
std::cin >> b[i];
st.insert(b[i]);
}
int count = n;
for (int i = 0; i < n; i++) {
auto it = st.find(a[i]);
if ( it!= st.end()) {
count--;
st.erase(it);
}
}
std::cout << count << "\n";
//system("pause");
} | codeforces | 37 | 483 |
39958843 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,x=0;
cin>>n;
std::vector <std::string> a,b;
for (int i=0;i<n;++i)
{
string s;cin>>s;
a.push_back(s);
}
for (int i=0;i<n;++i)
{
string s;cin>>s;
b.push_back(s);
}
for(int i=0;i<n;++i)
{
int check=1;
for(int j=0;j<b.size();++j)
{
if(a[i]==b[j])
{
b.erase(b.begin()+j);
check=0;
break;
}
}
if(check==1)
x++;
}
cout<<x;
return 0;
} | codeforces | 37 | 483 |
40512325 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include <bits/stdc++.h>
using namespace std;
int n,i,x,ok,sol,j;
string s,s1;
int main()
{
ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
map<string,int> m;
map<string,int> m1;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>s;
m[s]++;
}
for(i=1;i<=n;i++)
{
cin>>s;
m1[s]++;
}
sol=n;
for(auto x:m)
{
sol-=min(x.second,m1[x.first]);
}
cout<<sol;
return 0;
}
| codeforces | 37 | 483 |
99067966 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include<algorithm>
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
int n;
int m,i;
scanf("%d",&n);
string str;
map<string,int> mp;
for(i=0;i<n;i++){
cin>>str;
mp[str]++;
}
m=0;
for(i=0;i<n;i++){
cin>>str;
if(mp[str]>=1){
m++;
mp[str]--;
}
}
printf("%d",n-m);
return 0;
}
| codeforces | 37 | 483 |
99067966 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include<algorithm>
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
int n;
int m,i;
scanf("%d",&n);
string str;
map<string,int> mp;
for(i=0;i<n;i++){
cin>>str;
mp[str]++;
}
m=0;
for(i=0;i<n;i++){
cin>>str;
if(mp[str]>=1){
m++;
mp[str]--;
}
}
printf("%d",n-m);
return 0;
}
| codeforces | 37 | 483 |
39705176 | 1000A | -1 | cpp | Accepted | 30 | 12,288 | #include <bits/stdc++.h>
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long long ll;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int n; cin >> n;
vector <string> f(n);
for (auto &e:f) cin >> e;
string el;
int ans = 0;
for (int i = 0; i < n; i++) {
cin >> el;
auto q = find(f.begin(), f.end(), el);
if (q != f.end()) {
f.erase(q);
}
else ans++;
}
cout << ans;
return 0;
}
| codeforces | 37 | 484 |
39709998 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <bits/stdc++.h>
using namespace std;
int n;
string s;
const string size[9] = {"M", "S", "L", "XS", "XL", "XXS", "XXL", "XXXS", "XXXL"};
map<string, int> mymap;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n;
for (int i=1; i<=n; i++) cin >> s, mymap[s]++;
for (int i=1; i<=n; i++) cin >> s, mymap[s]--;
int res = 0;
for (int i=0; i<9; i++)
if (mymap[size[i]] != 0) res += abs(mymap[size[i]]);
cout << res/2;
} | codeforces | 37 | 484 |
58669579 | 1000A | -1 | cpp | Accepted | 31 | 16,044,032 | #include<bits/stdc++.h>
#include <cstring>
using namespace std;
int a,b,c,man,j,mix,x,y,z,ans,ans1,l,r,d[10];
// vector<int> v,v1;
string s,s1,s2;
// deque<int> dq;
map<string, int> mp,mp1;
bool o,bo;
long double ld;
pair<long long, long long> p[1000000];
int main(){
cin>>a;
for(int i = 0; i < a; i++){
cin>>s;mp[s]++;
}
for(int i = 0; i < a; i++){
cin>>s;
if(mp[s]!=0) mp[s]--;
else ans++;
}
cout<<ans;
} | codeforces | 37 | 484 |
62384406 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
const double pi = 3.14159265358979323846;
typedef long long ll;
int main()
{
int n;
cin>>n;
map<string,int>m;
string s;
for(int i=0;i<n;i++)
{
cin>>s;
m[s]++;
}
int k=0;
for(int i=0;i<n;i++)
{
cin>>s;
if(m[s]>0)
{
m[s]--;
}
else
k++;
}
cout<<k;
return 0;
}
| codeforces | 37 | 484 |
106928113 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n;
cin>>n;
map<string, ll> m;
string str;
for(int i = 0; i < n; i++){
cin>>str;
m[str]++;
}
ll count = 0;
for(int i = 0; i < n; i++){
cin>>str;
if(m.count(str)){
if(m[str] > 0){
count++;
m[str]--;
}
}
}
cout<<n-count<<endl;
return 0;
} | codeforces | 37 | 484 |
39734993 | 1000A | -1 | cpp | Accepted | 15 | 12,288 | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
map <string, int> mp;
string s;
cin>>n;
for(int i=0;i<n;i++)
{cin>>s;
mp[s]++;}
for(int i=0;i<n;i++)
{cin>>s;
mp[s]--;
}
map <string,int>::iterator it;
int cnt=0;
for(it=mp.begin();it!=mp.end();it++)
{
// cout<<it->first<<" "<<it->second<<endl;
if(it->second>0)
cnt=cnt+it->second;
}
cout<<cnt;
return 0;
} | codeforces | 37 | 485 |
40072638 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <bits/stdc++.h>
using namespace std;
int x,n,ans;
string s[105],v;
bool ok;
int main()
{
cin>>n;
for(int i=0;i<n;i++){
cin>>s[i];
}
for(int i=0;i<n;i++){
cin>>v;
for(int j=0;j<n;j++){
if(v==s[j]){
ok=true;
s[j]="0";
break;}
}
if(!ok)
ans++;
v.clear();
ok=false;
}
cout<<ans;
return 0;
}
| codeforces | 37 | 485 |
48301976 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
int n;
cin>>n;
map<string,int>m;
for(int i=0;i<n;i++)
{
string s;
cin>>s;
m[s]++;
}
int ans=0;
for(int i=0;i<n;i++)
{
string s;
cin>>s;
if(m[s]>0)
m[s]--;
}
for(auto it=m.begin();it!=m.end();it++)
{
ans+=it->second;
}
cout<<ans<<endl;
} | codeforces | 37 | 485 |
61317519 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <iostream>
#include <algorithm>
#include <map>
using namespace std;
const int maxn = 105;
string qian[maxn];
string jin[maxn];
int vis[maxn] = {0};
map<string, int> m;
map<string, int> p;
int main()
{
int n;
scanf("%d", &n);
int ans = 0;
for(int i = 0; i < n; i++)
{
cin >> qian[i];
m[qian[i]]++;
}
for(int i = 0; i < n; i++)
{
cin >> jin[i];
if(m[jin[i]] > 0)
m[jin[i]]--;
else ans++;
}
cout << ans << endl;
return 0;
}
| codeforces | 37 | 485 |
112117107 | 1000A | -1 | cpp | Accepted | 15 | 32,768 | #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
#define fi first
#define sc second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define rep(i,m,n) for(int i=m;i<n;i++)
#define repn(i,m,n) for(int i=m;i<=n;i++)
const int maxn=1e5+99;
map<string,int> m;
string s;
int ans=0;
int n;
int main(){
cin>>n;
rep(i,0,n){
cin>>s;
m[s]++;
}
rep(i,0,n){
cin>>s;
if(m[s]!=0) m[s]--;
else ans++;
}
cout<<ans<<endl;
}
| codeforces | 37 | 485 |
39704629 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define piii pair<pii,int>
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
int main(){
int n;
cin>>n;
multiset<string> x;
string s;
for(int i=0;i<n;i++){
cin>>s;
x.insert(s);
}
for(int i=0;i<n;i++){
cin>>s;
if(x.find(s)!=x.end()){
x.erase(x.find(s));
}
}
cout<<x.size()<<endl;
} | codeforces | 37 | 486 |
39712946 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll n,count=0,i,j,k;
cin>>n;
string s,s1,s2;
vector<string> vi1,vi2;
map<string,ll> mp;
for(i=0;i<n;i++){
cin>>s;
vi1.push_back(s);
mp[s]++;
}
for(i=0;i<n;i++){
cin>>s;
vi2.push_back(s);
mp[s]--;
}
map <string ,ll> :: iterator itr;
for (itr = mp.begin(); itr != mp.end(); ++itr){
if(itr->second!=0){
count+=abs(itr->second);
}
}
cout<<count/2;
} | codeforces | 37 | 486 |
39736007 | 1000A | -1 | cpp | Accepted | 15 | 8,192 | #include <bits/stdc++.h>
using namespace std;
map<string,int>mp;
int main()
{
mp["M"]=0;mp["L"]=0;mp["S"]=0;mp["XL"]=0;mp["XS"]=0;mp["XXL"]=0;mp["XXS"]=0;mp["XXXL"]=0;mp["XXXS"]=0;
int n;
cin>>n;
string s;
int counter=0;
for(int i=0;i<n;i++)
{
cin>>s;
mp[s]++;
}
for(int i=0;i<n;i++)
{
cin>>s;
mp[s]--;
if(mp[s]<0)
counter++;
}
cout<<counter;
return 0;
}
| codeforces | 37 | 486 |
40078437 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <algorithm>
#include <queue>
#include <functional>
#include <cstdio>
#include <string>
#include <iostream>
#include <map>
using namespace std;
vector<string>v;
int main()
{
int n;
string a;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a;
v.push_back(a);
}
vector<string>::iterator it;
int ans = 0;
for (int i=0;i<n;i++)
{
cin >> a;
it = find(v.begin(), v.end(), a);
if ( it== v.end())
ans++;
else
v.erase(it);
}
cout << ans << endl;
return 0;
} | codeforces | 37 | 486 |
40661990 | 1000A | -1 | cpp | Accepted | 31 | 196,608 | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
map <string, int> m1, m2, visited;
int i, n;
cin>>n;
string s[1005], t[1005];
for(i=0;i<n;i++) {
cin>>s[i];
m1[s[i]]++;
}
for(i=0;i<n;i++) {
cin>>t[i];
m2[t[i]]++;
}
int c = 0;
for(i=0;i<n;i++) {
if(!visited[s[i]]) {
if(m1[s[i]] > m2[s[i]]) c += (m1[s[i]] - m2[s[i]]);
visited[s[i]] = 1;
}
}
cout<<c<<endl;
return 0;
}
| codeforces | 37 | 486 |
40661990 | 1000A | -1 | cpp | Accepted | 31 | 196,608 | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
map <string, int> m1, m2, visited;
int i, n;
cin>>n;
string s[1005], t[1005];
for(i=0;i<n;i++) {
cin>>s[i];
m1[s[i]]++;
}
for(i=0;i<n;i++) {
cin>>t[i];
m2[t[i]]++;
}
int c = 0;
for(i=0;i<n;i++) {
if(!visited[s[i]]) {
if(m1[s[i]] > m2[s[i]]) c += (m1[s[i]] - m2[s[i]]);
visited[s[i]] = 1;
}
}
cout<<c<<endl;
return 0;
}
| codeforces | 37 | 486 |
39706276 | 1000A | -1 | cpp | Accepted | 15 | 24,576 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
int n;
cin>>n;
map<string,int> a,b;
for(int i = 0; i < n; i++) {
string s;
cin>>s;
a[s]++;
}
for(int i = 0; i < n; i++) {
string s;
cin>>s;
b[s]++;
}
int c = max(abs(a["M"]-b["M"]), max(abs(a["S"]-b["S"]), abs(a["L"]-b["L"])));
int d = abs(a["XS"]-b["XS"]);
int e = abs(a["XXS"]-b["XXS"]);
int f = abs(a["XXXS"]-b["XXXS"]);
cout<<(c+d+e+f);
return 0;
}
| codeforces | 37 | 487 |
39707307 | 1000A | -1 | cpp | Accepted | 30 | 20,480 | #include <bits/stdc++.h>
using namespace std;
#define int long long
int c,n,d;string s[100],s1[100];
map<string,int> m1,m2;
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin>>n;
for(int i=0;i<n;i++){cin>>s[i];m1[s[i]]++;}
for(int i=0;i<n;i++){cin>>s1[i];if(m1[s1[i]])m1[s1[i]]--;else m2[s1[i]]++;}
for (std::map<string,int>::iterator it=m2.begin(); it!=m2.end(); ++it)
c+=it->second;
cout<<c<<endl;
return 0;
} | codeforces | 37 | 487 |
39801776 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int ans = 0;
cin >> n;
map<string, int> s;
for(int i=0; i<n; i++){
string size;
cin>> size;
s[size] = s[size] + 1;
}
for(int i=0; i<n; i++){
string size;
cin>> size;
if(s[size] != 0){
s[size] = s[size] - 1;
}else{
ans++;
}
}
cout << ans << endl;
} | codeforces | 37 | 487 |
40658993 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <map>
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int inf = 1 << 30;
const int Maxn = 1e5+5;
map<string,int> s;
int main ()
{
int n;
scanf("%d",&n);
string b;
int a[1009];
for (int i = 1; i <= n; i++){
cin >> b;
s[b]++;
}
int sum = 0;
for (int i = 1; i <= n; i++){
cin >> b;
if (s[b] == 0) sum++;
else s[b]--;
}
printf("%d\n",sum);
} | codeforces | 37 | 487 |
40831791 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i,r=0;
cin>>n;
string s;
map<string,int> m;
m["L"]=0,m["M"]=1,m["S"]=2,m["XL"]=3,m["XS"]=4,m["XXL"]=5,m["XXS"]=6,m["XXXL"]=7,m["XXXS"]=8;
vector<int> v(9);
for(i=0;i<n;i++)
{
cin>>s;
v[m[s]]++;
}
for(i=0;i<n;i++)
{
cin>>s;
v[m[s]]--;
}
for(i=0;i<9;i++)
{
if(v[i]>0)
r+=v[i];
}
cout<<r;
} | codeforces | 37 | 487 |
41216253 | 1000A | -1 | cpp | Accepted | 31 | 0 | #include<iostream>
#include<string.h>
using namespace std;
int main(){
int n;
int flaga[105],flagb[105];
char a[105][10],b[105][10];
cin>>n;
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<n;i++)
cin>>b[i];
memset(flagb,1,sizeof(flagb));
int sum=0;
for(int i=0;i<n;i++)
{
bool check=false;
for(int j=0;j<n;j++)
if((strcmp(a[i],b[j])==0) && (flagb[j])) {
check=true;
flagb[j]=0;
break;
}
if (check) sum++;
}
cout<<n-sum<<endl;
return 0;
} | codeforces | 37 | 487 |
44938554 | 1000A | -1 | cpp | Accepted | 31 | 28,672 | #include <cstdio>
#include <cstring>
const int MAXN=110;
char s[MAXN][MAXN], t[MAXN][MAXN];
bool a[MAXN], b[MAXN];
int main()
{
// freopen("CF1000A.in", "r", stdin);
// freopen("CF1000A.out", "w", stdout);
int n;
scanf("%d", &n);
for (int i=1; i<=n; i++) scanf("%s", s[i]);
for (int i=1; i<=n; i++) scanf("%s", t[i]);
int ans=n;
for (int i=1; i<=n; i++)
for (int j=1; j<=n; j++)
if (!a[i]&&!b[j]&&!strcmp(s[i], t[j]))
a[i]=b[j]=1, ans--;
printf("%d\n", ans);
return 0;
} | codeforces | 37 | 487 |
72568343 | 1000A | -1 | cpp | Accepted | 15 | 4,841,472 | #include <bits/stdc++.h>
using namespace std;
string a[100005],b[100005];
int bk1[10][305],bk2[10][305],mk[105];
int main()
{
int n,ans=0;
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i],bk1[a[i].size()][a[i][a[i].size()-1]]++;
for(int i=1;i<=n;i++) cin>>b[i],bk2[b[i].size()][b[i][b[i].size()-1]]++;
mk[1]='S',mk[2]='L',mk[3]='M';
for(int i=1;i<=4;i++)
for(int j=1;j<=3;j++) if(bk1[i][mk[j]]>bk2[i][mk[j]]) ans+=bk1[i][mk[j]]-bk2[i][mk[j]];
cout<<ans;
}
| codeforces | 37 | 487 |
72568343 | 1000A | -1 | cpp | Accepted | 15 | 4,841,472 | #include <bits/stdc++.h>
using namespace std;
string a[100005],b[100005];
int bk1[10][305],bk2[10][305],mk[105];
int main()
{
int n,ans=0;
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i],bk1[a[i].size()][a[i][a[i].size()-1]]++;
for(int i=1;i<=n;i++) cin>>b[i],bk2[b[i].size()][b[i][b[i].size()-1]]++;
mk[1]='S',mk[2]='L',mk[3]='M';
for(int i=1;i<=4;i++)
for(int j=1;j<=3;j++) if(bk1[i][mk[j]]>bk2[i][mk[j]]) ans+=bk1[i][mk[j]]-bk2[i][mk[j]];
cout<<ans;
}
| codeforces | 37 | 487 |
76476909 | 1000A | -1 | cpp | Accepted | 30 | 16,384 | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 20;
int n, ans;
string s[maxn], t[maxn];
int main () {
cin >> n;
for (int i = 0; i < n; i++)
cin >> s[i];
for (int i = 0; i < n; i++)
cin >> t[i];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (s[i] == t[j] && s[i] != "#") {
s[i] = "#";
t[j] = "#";
}
}
}
for (int i = 0; i < n; i++)
if (s[i] != "#")
ans++;
cout << ans;
return 0;
}
| codeforces | 37 | 487 |
101492668 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int n , ans , cnt;
string s ;
vector <string> a ;
multiset <string>::iterator it ;
int main(){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n ;
for (int i = 0 ; i < n ; i++)
cin >> s , a.push_back(s) ;
for (int i = 0 ; i < n ; i++){
cin >> s ;
for (int j = 0 ; j < n ; j++){
if (a[j]==s){
a[j] = '0' , cnt++ ;
break;
}
}
}
cout << n-cnt;
}
| codeforces | 37 | 487 |
39707998 | 1000A | -1 | cpp | Accepted | 30 | 16,384 | #include<bits/stdc++.h>
#define ll long long
#define INF 20000000000
#define EPS 0.0000000001
#define f first
#define s second
using namespace std;
int main(){
ll n;
cin>>n;
unordered_map<string,ll>mp,np;
for(ll i=0;i<n;i++){
string ss;
cin>>ss;
mp[ss]++;
}
for(ll i=0;i<n;i++){
string ss;
cin>>ss;
if(mp[ss]>0){
mp[ss]--;
}else{
np[ss]++;
}
}
ll ans=0;
for(auto x:np){
ans+=x.second;
}
cout<<ans<<endl;
return 0;
} | codeforces | 37 | 488 |
39713157 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | /* Dejwo to ziomal ®© */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(0);
int n;
cin>>n;
map<string, int> M;
for(int i=0; i<n; i++)
{
string a; cin>>a;
M[a]++;
}
for(int i=0; i<n; i++)
{
string a; cin>>a;
M[a]--;
}
int ile = 0;
for(auto m:M)if(m.second > 0)ile+=m.second;
cout<<ile<<"\n";
return 0;
}
| codeforces | 37 | 488 |
41588780 | 1000A | -1 | cpp | Accepted | 31 | 147,456 | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
multiset<string> a;
// vector<string> b;
for(int i=0;i<n;i++){
string s;
cin >> s;
a.insert(s);
// cout << a[i]<<endl;
}
for(int i=0;i<n;i++){
string s;
cin >> s;
// b.push_back(s);
auto g = a.find(s);
if(g!=a.end())a.erase(g);
// cout << a[i]<<endl;
}
cout << a.size();
return 0;
}
| codeforces | 37 | 488 |
41588780 | 1000A | -1 | cpp | Accepted | 31 | 147,456 | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
multiset<string> a;
// vector<string> b;
for(int i=0;i<n;i++){
string s;
cin >> s;
a.insert(s);
// cout << a[i]<<endl;
}
for(int i=0;i<n;i++){
string s;
cin >> s;
// b.push_back(s);
auto g = a.find(s);
if(g!=a.end())a.erase(g);
// cout << a[i]<<endl;
}
cout << a.size();
return 0;
}
| codeforces | 37 | 488 |
48060870 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int MAXN = 200000 + 228;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int n, ans = 0, cnt = 0;
cin >> n;
multiset <string> st;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
st.insert(s);
}
for (int i = 0; i < n; i++) {
string s;
cin >> s;
if (st.count(s)) {
st.erase(st.find(s));
cnt++;
}
}
cout << n - cnt;
return 0;
} | codeforces | 37 | 488 |
127840634 | 1000A | -1 | cpp | Accepted | 31 | 3,891,200 | #include <bits/stdc++.h>
using namespace std;
multiset<string> st1, st2, st3;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
string s;
cin >> s;
st1.insert(s);
}
for (int i = 0; i < n; ++i) {
string s;
cin >> s;
st2.insert(s);
}
set_difference(st1.begin(), st1.end(), st2.begin(), st2.end(), inserter(st3, st3.begin()));
cout << st3.size() << endl;
return 0;
}
| codeforces | 37 | 488 |
127840634 | 1000A | -1 | cpp | Accepted | 31 | 3,891,200 | #include <bits/stdc++.h>
using namespace std;
multiset<string> st1, st2, st3;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
string s;
cin >> s;
st1.insert(s);
}
for (int i = 0; i < n; ++i) {
string s;
cin >> s;
st2.insert(s);
}
set_difference(st1.begin(), st1.end(), st2.begin(), st2.end(), inserter(st3, st3.begin()));
cout << st3.size() << endl;
return 0;
}
| codeforces | 37 | 488 |
39704512 | 1000A | -1 | cpp | Accepted | 31 | 151,552 | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define N (1<<17)
#define M 1000000007
using namespace std;
int n, ans;
string s;
multiset<string> st;
vector<string> v;
int main() {
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
cin >> n;
for(int i=0; i<n; i++) {
cin >> s;
st.insert(s);
}
for(int i=0; i<n; i++) {
cin >> s;
if(st.find(s)!=st.end())
st.erase(st.find(s));
else
ans++;
}
cout << ans;
}
| codeforces | 37 | 489 |
39714305 | 1000A | -1 | cpp | Accepted | 15 | 8,192 | #include <iostream>
using namespace std;
int main()
{
// your code goes here
int n,i,j,count=0;
cin>>n;
string arr[n];
string arr1[n];
for(i=0;i<n;i++)
{
cin>>arr[i];
}
for(i=0;i<n;i++)
{
cin>>arr1[i];
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(arr[i].compare(arr1[j])==0)
{
arr1[j]="";
count++;
break;
}
}
}
cout<<(n-count)<<endl;
return 0;
}
| codeforces | 37 | 489 |
39717956 | 1000A | -1 | cpp | Accepted | 30 | 151,552 | #include <iostream>
#include <cmath>
#include <set>
using namespace std;
int main() {
int n;
string r;
multiset <string> set1;
multiset <string>::iterator it;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> r;
set1.insert(r);
}
cout << '\n';
for (int j = 0; j < n; j++) {
cin >> r;
if (set1.find(r) != set1.end()) {
set1.erase(set1.find(r));
}
}
cout << set1.size();
return 0;
}
| codeforces | 37 | 489 |
39719116 | 1000A | -1 | cpp | Accepted | 15 | 147,456 | #include <bits/stdc++.h>
using namespace std ;
int main () {
int n ;
cin >> n ;
multiset <string> S ;
for (int i = 1 ; i <= n ; i++) {
string t ;
cin >> t ;
S.insert(t) ;
}
int ans = 0 ;
for (int i = 1 ; i <= n ; i++) {
string t ;
cin >> t ;
if (S.find(t) != S.end()) {
S.erase(S.find(t)) ;
}
else {
ans++;
}
}
cout << ans ;
}
| codeforces | 37 | 489 |
40644860 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <bits/stdc++.h>
using namespace std;
int n;
map<string,int> m;
/*
struct node
{
string s;
int len;
}a[110],b[110];
bool cmp(node a,node b)
{
if(a.len==b.len) return a.s<b.s;
else return a.len<b.len;
}
*/
int main()
{
cin>>n;
string s;
for(int i=0;i<n;i++)
{
cin>>s;
m[s]++;
}
for(int i=0;i<n;i++)
{
cin>>s;
m[s]--;
}
int cnt=0;
for(map<string,int>::iterator it=m.begin();it!=m.end();it++)
{
cnt += max(0,it->second);
}
cout<<cnt<<endl;
return 0;
} | codeforces | 37 | 489 |
39795242 | 1000A | -1 | cpp | Accepted | 31 | 12,288 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
string s;
vector<string> v1;
vector<string> v2;
for(int i=0;i<n;i++){
cin>>s;
v1.push_back(s);
}
for(int i=0;i<n;i++){
cin>>s;
v2.push_back(s);
}
int count=0;
vector<string>:: iterator it;
for(int i=0;i<n;i++){
for(it=v1.begin();it!=v1.end();it++){
if(v2[i]==*it){
count++;
v1.erase(it);
break;
}
}
}
cout<<n-count<<endl;
return 0;
} | codeforces | 37 | 490 |
51876408 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> ii;
const int N = 1e5 + 5;
int n,ans;
string s;
map <string,int> mpx;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin >> n;
for (int i = 1 ; i <= n ; i++) {
cin >> s;
mpx[s]++;
}
for (int i = 1 ; i <= n ; i++) {
cin >> s;
if (mpx[s])
mpx[s]--;
else
ans++;
}
cout << ans << endl;
} | codeforces | 37 | 490 |
39708358 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define ull unsigned long long
#define mp make_pair
#define ss second
#define ff first
int main()
{
int n;
cin>>n;
int ct=0;
map<string,int> ma;
for(int i=0;i<n;i++)
{
string s;
cin>>s;
ma[s]++;
}
for(int i=0;i<n;i++)
{
string s;
cin>>s;
if(ma.find(s)!=ma.end() && ma[s]>0)
{
ma[s]--;
ct++;
}
}
cout<<n-ct<<endl;
return 0;
}
| codeforces | 37 | 491 |
39725858 | 1000A | -1 | cpp | Accepted | 31 | 12,288 |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<string>a(n), b(n);
string str;
for(int i=0;i<n; i++)
{
cin>>a[i];
}
for(int i=0; i<n; i++)
{
cin>>b[i];
}
int c=0;
for(int i=0; i<n; i++)
{
for(int j=0; j<n; j++)
{
if(a[i]==b[j])
{
c++;
b[j]=-1;
break;
}
}
}
//cout<<c;
cout<<n-c;
return 0;
}
| codeforces | 37 | 491 |
41280903 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <iostream>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
map<string,int> ma;
int i,j,k;
string x;
cin>>n;
for(i=0;i<n;i++)
{
cin>>x;
if(ma.find(x)!=ma.end())
ma[x]+=1;
else
ma[x]=1;
}
vector<string> y;
for(i=0;i<n;i++)
{
cin>>x;
if(ma.find(x)!=ma.end() && ma[x]!=0)
ma[x]-=1;
else
y.push_back(x);
}
cout<<(y.size());
}
| codeforces | 37 | 491 |
82685116 | 1000A | -1 | cpp | Accepted | 31 | 266,240 | #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <map>
#include <iostream>
using namespace std;
map <string,int> a;
int main()
{
int i,n,sum=0;
string s;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
cin>>s;
a[s]++;
}
for(i=1;i<=n;i++)
{
cin>>s;
a[s]--;
if(a[s]<0)
sum++;
}
printf("%d\n",sum);
return 0;
}
| codeforces | 37 | 491 |
112309192 | 1000A | -1 | cpp | Accepted | 31 | 147,456 | #include "iostream"
#include "string"
#include "map"
using namespace std;
map<string,int> mp1,mp2;
int main()
{
mp1.clear();
mp2.clear();
int n,ans=0;
string s[105];
string str;
cin>>n;
for(int i=0;i<n;i++) {cin>>s[i];mp1[s[i]]++;}
for(int i=0;i<n;i++) {cin>>str;if(!mp1[str]) ans++;else mp2[str]++;}
for(int i=0;i<n;i++) if(mp2[s[i]]-mp1[s[i]]>0) ans+=mp2[s[i]]-mp1[s[i]],mp2[s[i]]=-1;
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 491 |
122535271 | 1000A | -1 | cpp | Accepted | 31 | 4,325,376 | #include <iostream>
using namespace std;
const int MAX=110;
string a[MAX],b[MAX];
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 sum=0;
for(int i=1;i<=n;i++){
int flow=1;
for(int j=1;j<=n;j++){
if(b[i]==a[j])
{
flow=0;
a[j]="0";
break;
}
// if(flow) sum++;
}
if(flow) sum++;
}
cout<<sum;
return 0;
}
| codeforces | 37 | 491 |
39730236 | 1000A | -1 | cpp | Accepted | 15 | 24,576 | #include<bits/stdc++.h>
using namespace std;
int n;
map<string, int> a, b;
string s;
int main(void)
{
cin >> n;
for(int i = 0; i < n; ++i)
{
cin >> s; a[s]++;
}
for(int i = 0; i < n; ++i)
{
cin >> s; b[s]++;
}
int rt = n;
for(auto t = a.begin(); t != a.end(); ++t)
{
//cout << t << endl;
//cout << t->first << endl;
rt -= min(t->second, b[t->first]);
}
cout << rt << endl;
}
| codeforces | 37 | 492 |
39871736 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
map<string, int> cnt[2];
int main() {
int n;
cin >> n;
for (int lnum = 0; lnum < 2; ++lnum)
for (int i = 0; i < n; ++i) {
string cur;
cin >> cur;
cnt[lnum][cur]++;
}
int ans = 0;
for (pair<string, int> cp: cnt[0])
ans += max(0, cp.second - cnt[1][cp.first]);
cout << ans;
return 0;
} | codeforces | 37 | 492 |
39871945 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
string s;
int n;
int main()
{
while(scanf("%d",&n) != EOF)
{
int ans = 0;
map<string,int> q;
for(int i = 1;i <= n;i++)
{
cin >> s;
q[s]++;
}
for(int i = 1;i <= n;i++)
{
cin >> s;
if(q[s] > 0) q[s]--;
else ans++;
}
printf("%d\n",ans);
}
return 0;
} | codeforces | 37 | 492 |
39879840 | 1000A | -1 | cpp | Accepted | 31 | 155,648 | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n; cin >> n;
string s;
multiset<string> a;
for (int i = 0; i < n; ++i) {
cin >> s; a.insert(s);
}
multiset<string> b;
for (int i = 0; i < n; ++i) {
cin >> s;
auto it = a.find(s);
if (it == a.end()) {
b.insert(s);
} else {
a.erase(it);
}
}
cout << (a.size() + b.size()) / 2 << endl;
}
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
solve();
return 0;
}
| codeforces | 37 | 492 |
39969143 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include<bits/stdc++.h>
using namespace std;
#define MT(a,b) memset(a,b,sizeof(a))
#define INF INT_MAX
#define ONF INT_MIN
#define ll long long
const int maxn = 3e3+5;
int main()
{
int n;cin>>n;
map<string ,int >mp;
for(int i=0;i<n;i++)
{
string s;cin>>s;
mp[s]++;
}
int ans=0;
for(int i=0;i<n;i++)
{
string s;cin>>s;
if(!mp[s])ans++;
else mp[s]--;
}
cout<<ans<<endl;
return 0;
}
| codeforces | 37 | 492 |
72570561 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<bits\stdc++.h>
using namespace std;
int n;
int res=0;
string t[110];
string f[110];
map <string,int>gg;
int main(){
cin>>n;
for(int i=0;i<n;i++){
string s;
cin>>s;
gg[s]++;
}
for(int i=0;i<n;i++){
string x;
cin>>x;
gg[x]--;
}
int len;
map<string, int>::iterator iter;
for(iter = gg.begin(); iter!=gg.end(); iter++) {
if(iter->second>0){
res+=iter->second;
}
}
cout<<res<<endl;
return 0;
}
| codeforces | 37 | 492 |
77039418 | 1000A | -1 | cpp | Accepted | 31 | 159,744 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
map<string,int>a;
map<string,int>b;
for(int i=1;i<=n;i++)
{
string s;
cin>>s;
a[s]++;
}
for(int i=1;i<=n;i++)
{
string s;
cin>>s;
b[s]++;
}
int sum=0;
map<string,int>::iterator it;
for(it=a.begin();it!=a.end();it++)
sum+=max(0,a[it->first]-b[it->first]);
cout<<sum<<endl;
}
| codeforces | 37 | 492 |
88021186 | 1000A | -1 | cpp | Accepted | 31 | 3,874,816 | #include<bits/stdc++.h>
using namespace std;
int main()
{
long n; cin>>n;
map<string, long> mp1, mp2;
for(long i=1; i<=n; i++)
{
string s; cin>>s;
mp1[s]++;
}
for(long i=1; i<=n; i++)
{
string s; cin>>s;
mp2[s]++;
}
long cnt=0;
cnt+=abs(mp1["XS"]-mp2["XS"]);
cnt+=abs(mp1["XXS"]-mp2["XXS"]);
cnt+=abs(mp1["XXXS"]-mp2["XXXS"]);
cnt+=max(abs(mp1["S"]-mp2["S"]), max(abs(mp1["M"]-mp2["M"]), abs(mp1["L"]-mp2["L"])));
cout<<cnt;
}
| codeforces | 37 | 492 |
93897183 | 1000A | -1 | cpp | Accepted | 31 | 16,384 | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr);
int n; cin>>n;
vector<string> a(n), b(n);
map<string, int> cnt;
for(int i = 0; i < n; i++) {
cin>>a[i];
cnt[a[i]]++;
}
int same = 0;
for(int i = 0; i < n; i++) {
cin>>b[i];
if(cnt[b[i]] != 0) {
same++;
cnt[b[i]]--;
}
}
cout<<n-same<<endl;
}
| codeforces | 37 | 492 |
39704697 | 1000A | -1 | cpp | Accepted | 15 | 16,384 | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, ans = 0;
cin >> n;
ans = n;
vector<string> v(n);
string s;
for (int i = 0; i < n; i++)
cin >> v[i];
for (int i = 0; i < n; i++)
{
cin >> s;
for (int j = 0; j < n; j++)
if (s == v[j])
{
v[j] = "DELETED";
ans--;
break;
}
}
cout << ans;
return 0;
}
| codeforces | 37 | 493 |
127432292 | 1000A | -1 | cpp | Accepted | 31 | 3,739,648 | #include <bits/stdc++.h>
using namespace std;
#define N 2021
#define mt(x) memset(x, 0, sizeof x)
typedef long long ll;
string s;
int n;
void solve()
{
map<string,int>mp;
int 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;
}
int main()
{
cin>>n;
solve();
return 0;
} | codeforces | 37 | 493 |
39704540 | 1000A | -1 | cpp | Accepted | 15 | 16,384 | #include <bits/stdc++.h>
#define MN 1001000
using namespace std;
typedef long long ll;
map<string, int> freq;
string str;
ll n, ans;
int main() {
cin >> n;
for(int i = 0; i < n; i++) {
cin >> str;
freq[str]++;
}
for(int i = 0; i < n; i++) {
cin >> str;
freq[str]--;
}
for(auto a : freq) {
ans += abs(a.second);
}
assert(ans % 2 == 0);
printf("%lld\n", ans / 2);
return 0;
}
| codeforces | 37 | 494 |
39704905 | 1000A | -1 | cpp | Accepted | 30 | 24,576 | #include <iostream>
using namespace std;
string s1[105];
bool V[105];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, ans = 0;
string t;
cin >> n;
for ( int i=0; i<n; ++i ) cin >> s1[i];
for ( int i=0; i<n; ++i ) {
cin >> t;
bool flag = false;
for ( int j=0; j<n; ++j ) {
if ( V[j] ) continue;
if ( s1[j] == t ) {
V[j] = true;
flag = true;
break;
}
}
if ( !flag ) {
ans++;
}
}
cout << ans << '\n';
return 0;
}
| codeforces | 37 | 494 |
39729771 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <unordered_map>
using namespace std;
unordered_map<string,int>mp;
int main(void)
{
// freopen("A.in","r",stdin);
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int i,n,ans=0;
cin>>n;
string str;
for(i=1;i<=n;++i)
{
cin>>str;
++mp[str];
}
for(i=1;i<=n;++i)
{
cin>>str;
int& tmp=mp[str];
if(tmp>0)--tmp;
else ++ans;
}
printf("%d\n",ans);
return 0;
} | codeforces | 37 | 494 |
39776094 | 1000A | -1 | cpp | Accepted | 31 | 0 | #include<stdio.h>
#include<string.h>
int main()
{
int n,count=0,i,j;
char A[205][10];
scanf("%d",&n);
for(i=0;i<=2*n-1;i++)
{
scanf("%s",A[i]);
}
for(i=0;i<=n-1;i++)
{
for(j=n;j<=2*n-1;j++)
{
if(strcmp(A[i],A[j])==0)
{
count++;
A[j][0]='\0';
break;
}
}
}
printf("%d",n-count);
return 0;
} | codeforces | 37 | 494 |
39798161 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include <cstdio>
#include <map>
#include <cstring>
#include <iostream>
int n, ans;
std::string s;
std::map<std::string, int> Map;
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; ++i) {
std::cin >> s;
++Map[s];
}
for (int i = 1; i <= n; ++i) {
std::cin >> s;
--Map[s];
}
for (std::map<std::string, int>::iterator it = Map.begin(); it != Map.end(); ++it) {
if (it->second > 0) {
ans += it->second;
}
}
printf("%d\n", ans);
return 0;
} | codeforces | 37 | 494 |
41229986 | 1000A | -1 | cpp | Accepted | 31 | 24,576 | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;
string f[105],s[105];
map <string,int>a,b;
//map <string,int>::iterator it;
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>f[i];
a[f[i]]++;
}
for(int i=0;i<n;i++)
{
cin>>s[i];
b[s[i]]++;
}
int ans=n;
map <string,int>::iterator it;
for(it=a.begin();it!=a.end();it++)
{
ans-=min(it->second,b[it->first]);
// cout<<ans<<" ";
}
cout<<ans<<endl;
} | codeforces | 37 | 494 |
85112284 | 1000A | -1 | cpp | Accepted | 31 | 3,739,648 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n,i,k=0; cin>>n; ll n1=n; unordered_map<string,ll> mp;
while(n--){
string t; cin>>t;
mp[t]++;
}
while(n1--){
string t; cin>>t;
mp[t]--;
}
string s[]={"S","M","L","XS","XXS","XXXS","XL","XXL","XXXL"};
//cout<<s[0];
for(i=0;i<9;i++){
//cout<<mp[s[i]]<<" ";
k+=abs(mp[s[i]]);
}
cout<<k/2;
return 0;
}
| codeforces | 37 | 494 |
39705368 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include <iostream>
#include <unordered_map>
#include <string.h>
using namespace std;
//ifstream cin("/home/mihai/Documents/C++/A/A.in");
//ofstream cout("/home/mihai/Documents/C++/A/A.out");
unordered_map <string, int> H;
int main()
{
int n;
cin >> n;
for(int i = 1; i <= n; i++)
{
string s;
cin >> s;
H[s]++;
}
for(int i = 1; i <= n; i++)
{
string s;
cin >> s;
H[s]--;
}
int ans = 0;
for(auto& i : H)
{
if(i.second > 0)
ans += i.second;
}
cout << ans;
}
| codeforces | 37 | 495 |
39705368 | 1000A | -1 | cpp | Accepted | 30 | 8,192 | #include <iostream>
#include <unordered_map>
#include <string.h>
using namespace std;
//ifstream cin("/home/mihai/Documents/C++/A/A.in");
//ofstream cout("/home/mihai/Documents/C++/A/A.out");
unordered_map <string, int> H;
int main()
{
int n;
cin >> n;
for(int i = 1; i <= n; i++)
{
string s;
cin >> s;
H[s]++;
}
for(int i = 1; i <= n; i++)
{
string s;
cin >> s;
H[s]--;
}
int ans = 0;
for(auto& i : H)
{
if(i.second > 0)
ans += i.second;
}
cout << ans;
}
| codeforces | 37 | 495 |
39705540 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<string> a(n), b(n);
for(auto &i : a) cin >> i;
for(auto &i : b) cin >> i;
int k = 0;
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
if (a[i] == b[j]) {
a[i] = "zero";
b[j] = "zero";
k++;
break;
}
}
}
cout << n - k;
return 0;
}
| codeforces | 37 | 495 |
39706190 | 1000A | -1 | cpp | Accepted | 31 | 823,296 | #include <bits/stdc++.h>
using namespace std;
string s;
int t[100000],n,t2[100000],ruchy;
int main()
{
cin>>n;
for(int i=0;n>i;i++)
{
cin>>s;
int su=0;
for(int j=0;s.size()>j;j++)
{
su+=(int)s[j]-'A';
}
t[su]++;
}
for(int i=0;n>i;i++)
{
cin>>s;
int su=0;
for(int j=0;s.size()>j;j++)
{
su+=s[j]-'A';
}
if(t[su]>0)
{
t[su]--;
}
else
ruchy++;
}
cout<<ruchy;
return 0;
}
| codeforces | 37 | 495 |
39754862 | 1000A | -1 | cpp | Accepted | 31 | 28,672 | #include <bits/stdc++.h>
using namespace std;
int main() {
map <string, int> c;
c["M"] = 0;
c["S"] = 0;
c["XS"] = 0;
c["XXS"] = 0;
c["XXXS"] = 0;
c["L"] = 0;
c["XL"] = 0;
c["XXL"] = 0;
c["XXXL"] = 0;
int n;
cin >> n;
for (int i=0; i<n; i++) {
string leit;
cin >> leit;
c[leit]++;
}
int qnt = 0;
for (int i=0; i<n; i++) {
string leit;
cin >> leit;
if (c[leit] == 0)
qnt++;
else
c[leit]--;
}
cout << qnt << endl;
} | codeforces | 37 | 495 |
39780678 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
double eps =1e-9;
map<int,int>mm;
int main()
{ ios_base::sync_with_stdio(0);cin.tie(0);
int n ;
cin>>n ;
string arr[n],arr2[n];
for(int i=0 ; i<n ; i++) cin>>arr[i];
for(int i=0 ; i<n ; i++) cin>>arr2[i];
for(int i=0 ; i<n ; i++)
{ for(int j=0 ; j<n ; j++)
if (arr[i]==arr2[j]) {arr[i]="."; arr2[j]="."; break;}
} long long sum=0;
for(int i=0 ; i<n ; i++) if (arr2[i]!=".") sum++;
cout<<sum;
return 0;
}
| codeforces | 37 | 495 |
41293880 | 1000A | -1 | cpp | Accepted | 30 | 151,552 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i,cnt=0,j=0;
cin>>n;
string s,t;
//vector<string> a;
//vector<string> b;
map<string,int> m1;
map<string,int> m2;
for(i=0;i<n;i++)
{
cin>>s;
//a.push_back(s);
m1[s]++;
}
for(i=0;i<n;i++)
{
cin>>s;
m2[s]++;
//b.push_back(s);
}
map<string,int> :: iterator it;
cnt=n;
for(it=m1.begin();it!=m1.end();it++)
{
cnt-=min(it->second,m2[it->first]);
}
cout<<cnt;
return 0;
} | codeforces | 37 | 495 |
42242329 | 1000A | -1 | cpp | Accepted | 31 | 32,768 | #include<iostream>#include<cstring>
#include<string>
#include<cstdio>
#define maxn 600
using namespace std;
string a[maxn],b[maxn];
int n;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i];
}
int sum=0;
for(int i=n+1;i<=2*n;i++)
{
cin>>b[i];
for(int j=1;j<=n;j++)
{
if(a[j]==b[i])
{
sum++;
a[j]="0";
break;
}
}
}
cout<<n-sum;
}
| codeforces | 37 | 495 |
46309192 | 1000A | -1 | cpp | Accepted | 31 | 4,096 | #include <bits/stdc++.h>
using namespace std;
map<string,int> num,num2;
int main(){
//freopen("a.txt","r",stdin);
ios::sync_with_stdio(0);
int n,i;
cin>>n;
for(i = 1;i <= n;i ++){
string s;
cin>>s;
num[s]++;
}
for(i = 1;i <= n;i ++){
string s;
cin>>s;
num2[s] ++;
}
int ans=0;
for(auto v:num2){
ans += max(0,num2[v.first]-num[v.first]);
}
cout<<ans;
return 0;
}
| codeforces | 37 | 495 |
61281163 | 1000A | -1 | cpp | Accepted | 31 | 8,192 | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,c=0,s;
cin>>n;
string arr[n],st;
for(int i=0; i<n; i++)
cin>>arr[i];
s=n;
for(int i=0; i<n; i++)
{
cin>>st;
for(int q=0; q<n; q++)
if(arr[q]==st)
{
c++;
arr[q]="##";
break;
}
if(c)
s--;
c=0;
}
cout<<s<<endl;
return 0;
}
| codeforces | 37 | 495 |
78086686 | 1000A | -1 | cpp | Accepted | 31 | 28,672 | #include <bits/stdc++.h>
#define rei register int
using namespace std;
int n;
int a[50][20];
int b[50][20];
int main(){
scanf("%d",&n); int ans(0);
for(rei i = 1;i <= n;++i){
string s; cin >> s; ++a[s[s.size() - 1] - 'A'][s.size()];
}
for(rei i = 1;i <= n;++i){
string s; cin >> s; ++b[s[s.size() - 1] - 'A'][s.size()];
}
for(rei i = 0;i <= 26;++i)
for(rei j = 1;j <= 4;++j) if(a[i][j] < b[i][j]) ans += b[i][j] - a[i][j];
cout << ans; return 0;
}
| codeforces | 37 | 495 |
39705342 | 1000A | -1 | cpp | Accepted | 31 | 20,480 | #include<bits/stdc++.h>
using namespace std;
#define rt return
int n;
int s[1000];
int main (){
vector<string> x;
vector<string> y2;
int a=0;
cin>>n;
x.resize(n);
y2.resize(n);
for(int i=0 ; i<n ;i++)cin >> x[i];
for(int i=0 ;i<n ;i++)cin >> y2[i];
for(int i=0 ; i<n ; i++){
for(int j=0 ; j<n ; j++){
if(x[i]==y2[j] && !s[j])
{s[j]=1; break;} } }
a=0;
for(int i=0 ; i<n ; i+=1)
{if(!s[i]){a+=1;} }
cout << a;
cout<<"\n";
rt 0;
}
| codeforces | 37 | 496 |
39712568 | 1000A | -1 | cpp | Accepted | 31 | 159,744 | #include <bits/stdc++.h>
using namespace std;
map<string, int> pre, now;
string str[9] = {"M","S","L","XS","XL","XXS","XXL","XXXS","XXXL"};
int main()
{
int n;
string tmp;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> tmp;
pre[tmp] += 1;
}
for (int i = 0; i < n; i++)
{
cin >> tmp;
now[tmp] += 1;
}
int ans = 0;
for (int i = 0; i < 9; i++)
{
ans += abs(pre[str[i]] - now[str[i]]);
}
cout << ans / 2 << endl;
//system("pause");
return 0;
} | codeforces | 37 | 496 |
39712568 | 1000A | -1 | cpp | Accepted | 31 | 159,744 | #include <bits/stdc++.h>
using namespace std;
map<string, int> pre, now;
string str[9] = {"M","S","L","XS","XL","XXS","XXL","XXXS","XXXL"};
int main()
{
int n;
string tmp;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> tmp;
pre[tmp] += 1;
}
for (int i = 0; i < n; i++)
{
cin >> tmp;
now[tmp] += 1;
}
int ans = 0;
for (int i = 0; i < 9; i++)
{
ans += abs(pre[str[i]] - now[str[i]]);
}
cout << ans / 2 << endl;
//system("pause");
return 0;
} | codeforces | 37 | 496 |