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
70408859
1000A
-1
cpp
Accepted
31
16,384
#include<bits/stdc++.h> using namespace std; #define For(i,x,y)for(i=x;i<=y;i++) map<string,int>mp; string str; int main() { int s,n,i; cin>>n; s=n; For(i,1,n) { cin>>str; if(!mp.count(str))mp[str]=1; else mp[str]++; } For(i,1,n) { cin>>str; if(mp.count(str)&&mp[str])s--,mp[str]--; } cout<<s; return 0; } /*3 XS XX M XS XS M*/
codeforces
37
378
76682714
1000A
-1
cpp
Accepted
31
151,552
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); string t; multiset<string> s; int n, ans = 0; cin >> n; for (int i = 0; i < n; i++) cin >> t, s.insert(t); for (int i = 0; i < n; i++) { cin >> t; if (s.find(t) != s.end()) s.erase(s.find(t)); else ans++; } cout << ans << endl; return 0; }
codeforces
37
378
89762426
1000A
-1
cpp
Accepted
31
16,384
#include<bits/stdc++.h> using namespace std; #define ll long long typedef pair<int,int> pii; int main(){ int n, i, j,ans=0; cin>>n; vector<string>a(n),b(n); for(i=0;i<n;i++){ cin>>a[i]; }for(i=0;j<n;j++){ cin>>b[j]; }for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(a[i]==b[j]){ b[j]='X'; ans++; break; } } }cout<<n-ans; }
codeforces
37
378
42671529
1000A
-1
cpp
Accepted
31
442,368
#include <bits/stdc++.h> using namespace std; int n; map<string, int> m1, m2; int main(){ scanf("%d", &n); for(int i=0;i<n;++i){ string s; cin >> s; m1[s]++; } for(int i=0;i<n;++i){ string s; cin >> s; m2[s]++; } int ans=0; for(auto it: m2){ ans+=max(m2[it.first]-m1[it.first], 0); } printf("%d\n", ans); return 0; }
codeforces
37
379
85715215
1000A
-1
cpp
Accepted
31
262,144
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; int n; map<string, int> m; string s; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> s; m[s]++; } int t = 0; for (int i = 0; i < n; i++) { cin >> s; if (m[s]) { m[s]--; } else { t++; } } cout << t << endl; return 0; }
codeforces
37
379
114283404
1000A
-1
cpp
Accepted
31
151,552
#include<map> #include<string> #include<iostream> #include<algorithm> using namespace std; map<string,int> f,g; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ string s; cin>>s; f[s]++; } for(int i=0;i<n;i++){ string s; cin>>s; g[s]++; } int x=n; for(auto i:f){ x -= min(i.second,g[i.first]); } cout<<x<<"\n"; return 0; }
codeforces
37
379
114283404
1000A
-1
cpp
Accepted
31
151,552
#include<map> #include<string> #include<iostream> #include<algorithm> using namespace std; map<string,int> f,g; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ string s; cin>>s; f[s]++; } for(int i=0;i<n;i++){ string s; cin>>s; g[s]++; } int x=n; for(auto i:f){ x -= min(i.second,g[i.first]); } cout<<x<<"\n"; return 0; }
codeforces
37
379
40730214
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> using namespace std; int main() { int n,count=0; string s; cin>>n; map<string,int>m; for(int i=0;i<n;i++) { cin>>s; m[s]++; } for(int i=0;i<n;i++) { cin>>s; if(m[s]>0) m[s]--; else count++; } cout<<count; return 0; }
codeforces
37
380
40686718
1000A
-1
cpp
Accepted
31
16,384
#include <iostream> #include <map> std::map<std::string,int> cnt; int main(){ int N; std::cin>>N; for(int i=0;i<N;i++){ std::string A; std::cin>>A; cnt[A]++; } for(int i=0;i<N;i++){ std::string A; std::cin>>A; cnt[A]--; } int cost=0; for(auto it:cnt){ if(it.second>0) cost+=it.second; } std::cout<<cost<<std::endl; return 0; }
codeforces
37
380
45510419
1000A
-1
cpp
Accepted
31
49,152
//in the name of god #include <iostream> using namespace std; int main(){ int a,d; string b[1000],c[1000]; cin>>a; for(int i=0;i<a;i++){ cin>>b[i]; } for(int j=0;j<a;j++){ cin>>c[j]; } d=a; for(int k=0;k<d;k++){ for(int h=0;h<d;h++){ if(b[k]==c[h]){ a--; c[h]="e"; break; } } } cout<<a; }
codeforces
37
380
39708026
1000A
-1
cpp
Accepted
30
12,288
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; string a[n],b[n]; int c[n],d[n]; for(int i=0;i<n;i++) { cin>>a[i]; c[i]=1; d[i]=0; } for(int i=0;i<n;i++) cin>>b[i]; int ans=0; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(b[i]==a[j] && c[j]==1) {c[j]=0;d[i]=1;break;} } if(d[i]==0) ans++; } cout<<ans; }
codeforces
37
381
121287297
1000A
-1
cpp
Accepted
31
12,288
#include <iostream> #include <cstring> using namespace std; int main(){ char a[105][8]={0},s[105]; int n,i,j,ans,vis[105]={0}; cin>>n; ans=n; for(i=0;i<n;i++) cin>>a[i]; for(i=0;i<n;i++) { cin>>s; for(j=0;j<n;j++) if(!vis[j]&&strcmp(a[j],s)==0){ vis[j]=1; ans--; break;} } cout<<ans<<endl; return 0; }
codeforces
37
381
39704714
1000A
-1
cpp
Accepted
31
159,744
#include <bits/stdc++.h> using namespace std; const int N = 120; int n, x, i, j, ans; string s; map<string, int> frq[2]; int main() { cin >> n; for (j = 0; j < 2; ++j) { for (i = 0; i < n; ++i) { cin >> s; frq[j][s]++; } } ans = n; for (auto& p : frq[1]) { ans -= min(frq[0][p.first], p.second); } cout << ans << endl; return 0; }
codeforces
37
382
40107999
1000A
-1
cpp
Accepted
31
548,864
#include<bits/stdc++.h> using namespace std; map<string,int> mp; map<string,int> mp2; map<string,bool> bo; int n,ans; string str,a[10010]; int main(){ scanf("%d",&n); ans=n; for (int i=1;i<=n;++i) cin>>str,mp[str]++; for (int i=1;i<=n;++i) cin>>a[i],mp2[a[i]]++; for (int i=1;i<=n;++i) if (!bo[a[i]]) ans-=min(mp[a[i]],mp2[a[i]]),bo[a[i]]=1; printf("%d",ans); }
codeforces
37
382
40192191
1000A
-1
cpp
Accepted
31
12,288
#include<iostream> #include<map> using namespace std; map<string,int>huaji; int n; int main(){ cin>>n; for(int i=0;i<n;i++){ string a; cin>>a; huaji[a]++; } for(int i=0;i<n;i++){ string a; cin>>a; huaji[a]--; } int ans=0; map<string,int>::iterator it; for(it=huaji.begin();it!=huaji.end();it++){ ans+=(it->second>0)?it->second:-(it->second); } cout<<ans/2; }
codeforces
37
382
42213592
1000A
-1
cpp
Accepted
31
151,552
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e6+5; int n,c; map <string,int> mp1,mp2; string x; int main() { cin >>n; for (int i=0;i<n;++i){ cin >>x; mp1[x]++; } for (int i=0;i<n;++i){ cin >>x; mp2[x]++; } for (auto i:mp2){ if (i.second>mp1[i.first]) c+=i.second-mp1[i.first]; } cout <<c; return 0; }
codeforces
37
382
86823442
1000A
-1
cpp
Accepted
31
3,731,456
#include <bits/stdc++.h> using namespace std; int main() { int x1=0,n,i; string s,s1; map<string,int>m1; cin>>n; for(i=1; i<=n; i++) { cin>>s; m1[s]=m1[s]+1; } for(i=1; i<=n; i++) { cin>>s1; if(m1[s1]==0) { x1++; } else { m1[s1]=m1[s1]-1; } } cout<<x1; }
codeforces
37
382
39722778
1000A
-1
cpp
Accepted
31
155,648
#include"bits/stdc++.h" #define ll long long int using namespace std; int main() { multiset<string>s; ll i,n; cin>>n; string x; for(i=0;i<n;i++) { cin>>x; s.insert(x); } for(i=0;i<n;i++) { cin>>x; auto d=s.find(x); if(d!=s.end()) s.erase(d); } cout<<s.size()<<"\n"; }
codeforces
37
383
39725309
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> #define int long long #define ld long double #define pb push_back #define N 1000007 #define mp make_pair #define ff first #define ss second using namespace std; int i,n,ans; string s; map <string,int> m; main(){ cin>>n; for(i=1;i<=n;i++) cin>>s,m[s]++; for(i=1;i<=n;i++){ cin>>s; if(m[s])m[s]--; else ans++; } cout<<ans; }
codeforces
37
383
40321362
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #include <map> #include <string> int main() { int n, ans = 0; std::string s; std::cin >> n; std::map<std::string, int> size; for (int i = 0; i < n; ++i) { std:: cin >> s; ++size[s]; } for (int i = 0; i < n; ++i) { std::cin >> s; if (size[s]) { --size[s]; } else { ++ans; } } std::cout << ans << std::endl; }
codeforces
37
383
74844245
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int n; cin >> n; string s[n]; int ans=0; for(int i=0;i<n;i++){ cin >> s[i]; } for(int i=0;i<n;i++){ string s1; cin >> s1; int j; for(j=0;j<n;j++){ if(s[j]==s1){ s[j]=""; break; } } if(j==n){ ans++; } } cout << ans << endl; }
codeforces
37
383
74844245
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int n; cin >> n; string s[n]; int ans=0; for(int i=0;i<n;i++){ cin >> s[i]; } for(int i=0;i<n;i++){ string s1; cin >> s1; int j; for(j=0;j<n;j++){ if(s[j]==s1){ s[j]=""; break; } } if(j==n){ ans++; } } cout << ans << endl; }
codeforces
37
383
39708240
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> using namespace std; int main() { 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 c=0; bool ss; for(int i=0;i<n;i++) { ss=false; for(int j=0;j<n;j++) if(a[i]==b[j]) { ss=true; b[j]=""; break; } if(!ss) c++; } cout<<c<<endl; }
codeforces
37
384
39725009
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL); ll n,ct(0); cin>>n; string s; map <string,ll> mp; for(ll i=0;i<n;i++) { cin>>s; ++mp[s]; } for(ll i=0;i<n;i++) { cin>>s; --mp[s]; } for(auto p:mp) if(p.second>0) ct+=p.second; cout<<ct; return 0; }
codeforces
37
384
40506070
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; int main() { int n,sum=0,i,j; cin>>n; string size1[101],size2[101]; for(int i=1;i<=n;i++) cin>>size1[i]; for(i=1;i<=n;i++) { cin>>size2[i]; for(j=1;j<=n;j++) { if(size2[i]==size1[j]) { size1[j]="hhh";break; } } if(j>n) sum++; } cout<<sum; }
codeforces
37
384
41645259
1000A
-1
cpp
Accepted
31
20,480
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N=100*1000+10; string s; int n,ans; map<string,int> a; int main() { cin >> n; for (int i=0;i<n;++i) { cin >> s; a[s]++; } for (int i=0;i<n;++i) { cin >> s; a[s]--; } for (auto it=a.begin();it!=a.end();++it) ans+=abs(it->second); cout << ans/2; return 0; }
codeforces
37
384
65709244
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; #define pb push_back typedef long long ll; const int inf=0x3f3f3f3f; map<string,int>mp; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ string a; cin>>a; mp[a]++; } int ans=0; for(int i=1;i<=n;i++){ string a; cin>>a; if(mp[a]>0) mp[a]--; else{ ans++; } } cout<<ans; return 0; }
codeforces
37
384
39742143
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 5e5 + 5; int main(){ ios_base::sync_with_stdio(false); int n; cin >> n; string a[n]; map<string, int> mp; for(int i = 0; i < n; i++){ cin >> a[i]; mp[a[i]]++; } int ans = 0; for(int i = 0; i < n; i++){ string x; cin >> x; if(mp[x]){ mp[x]--; }else{ ans++; } } cout << ans; }
codeforces
37
385
39707108
1000A
-1
cpp
Accepted
30
16,384
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<string> v1(n); for(int i=0;i<n;i++) cin>>v1[i]; vector<string> v2(n); for(int i=0;i<n;i++) cin>>v2[i]; for(int i=0;i<n;i++) { for(int j=0;j<v2.size();j++) { if(v1[i]==v2[j]) { v2.erase(v2.begin()+j); break; } } } cout<<v2.size(); return 0; }
codeforces
37
386
39707108
1000A
-1
cpp
Accepted
30
16,384
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<string> v1(n); for(int i=0;i<n;i++) cin>>v1[i]; vector<string> v2(n); for(int i=0;i<n;i++) cin>>v2[i]; for(int i=0;i<n;i++) { for(int j=0;j<v2.size();j++) { if(v1[i]==v2[j]) { v2.erase(v2.begin()+j); break; } } } cout<<v2.size(); return 0; }
codeforces
37
386
39721240
1000A
-1
cpp
Accepted
31
20,480
#include <iostream> #include <string> #include <map> using namespace std; int main() { map<string, int> A; // Codehorses int n; // 1≤n≤100 cin >> n; string s; for (int i = 0; i < n; i++) { cin >> s; A[s]++; } for (int i = 0; i < n; i++) { cin >> s; A[s]--; } n = 0; for (auto a : A) if (a.second > 0) n += a.second; cout << n; }
codeforces
37
386
39721240
1000A
-1
cpp
Accepted
31
20,480
#include <iostream> #include <string> #include <map> using namespace std; int main() { map<string, int> A; // Codehorses int n; // 1≤n≤100 cin >> n; string s; for (int i = 0; i < n; i++) { cin >> s; A[s]++; } for (int i = 0; i < n; i++) { cin >> s; A[s]--; } n = 0; for (auto a : A) if (a.second > 0) n += a.second; cout << n; }
codeforces
37
386
41230921
1000A
-1
cpp
Accepted
31
12,288
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<iostream> #define N 0x3f3f3f3f #include<map> using namespace std; int main() { int t; cin>>t; map<string,int>mp; string s; mp.clear(); for(int i=0;i<t;i++) { cin>>s; mp[s]++; } long long ans=0; for(int i=0;i<t;i++) { cin>>s; if(mp[s]==0) ans++; else mp[s]--; } cout<<ans<<endl; }
codeforces
37
386
41993659
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n; cin>>n; unordered_map<string,ll> a; ll i,ans=0; string b; for(i=0;i<n;i++){ cin>>b; a[b]++; } for(i=0;i<n;i++){ cin>>b; if(a[b]>0){ a[b]--; } else ans++; } cout<<ans<<endl; }
codeforces
37
387
39705252
1000A
-1
cpp
Accepted
31
28,672
#include<iostream> #include<cstdio> #include<cstring> using namespace std; string s1[105],s2[105]; int t[105]; int main() { int n,ans; cin>>n; ans=n; for(int i=1;i<=n;i++) cin>>s1[i]; for(int i=1;i<=n;i++) cin>>s2[i]; for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) { if(s1[i]==s2[j]&&t[j]==0) { ans--,t[j]=1; break; } } cout<<ans; }
codeforces
37
388
39717320
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> using namespace std; int n, ans; string s; map<string, int> ros; int main() { //freopen("i.inp","r",stdin); cin >> n; for(int i = 1; i <= n; i ++) cin >> s, ros[s] ++; for(int i = 1; i <= n; i ++) cin >> s, ros[s] --; for(auto it =ros.begin(); it != ros.end(); it ++) ans += abs(it -> second); cout << ans / 2; return 0; }
codeforces
37
388
39741362
1000A
-1
cpp
Accepted
15
262,144
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define ll long long int int main() { int n; cin>>n; map <string,int> mp; for(int i=0;i<n;i++) { string s; cin>>s; mp[s]++; } int cnt=0; //sort(v.begin(),v.end()); for(int i=0;i<n;i++) { string s; cin>>s; if(mp[s]>0) { mp[s]--; continue; } else cnt++; } cout<<cnt; return 0; }
codeforces
37
388
39759863
1000A
-1
cpp
Accepted
31
3,514,368
#include <bits/stdc++.h> using namespace std; int n; unordered_map<string,int> m[2]; string t; int main() { cin>>n; for(int i=0; i<n; i++) { cin>>t; m[0][t]++; } for(int i=0; i<n; i++) { cin>>t; m[1][t]++; } int ans = 0; for(auto it=m[0].begin(); it!=m[0].end(); it++) { ans -= min(it->second,m[1][it->first]); } cout << ans+n << endl; return 0; }
codeforces
37
388
39948340
1000A
-1
cpp
Accepted
30
303,104
#include <bits/stdc++.h> using namespace std; string a, b; map <string, int> p; int main() { int n, cnt = 0; ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; for (int i = 0; i < n; i++) { cin>> a; p[a]++; } for (int i = 0; i < n; i++) { cin>> b; if (p[b]==0) cnt++; else p[b]--; } cout << cnt << endl; return 0; }
codeforces
37
388
40899117
1000A
-1
cpp
Accepted
30
151,552
#include <bits/stdc++.h> using namespace std; const int MAXN = 110; int main() { int n; cin >> n; string s; multiset<string> ms; for(int i = 0; i < n; ++i) cin >> s, ms.insert(s); for(int i = 0; i < n; ++i) { cin >> s; multiset<string>::iterator it = ms.find(s); if(it != ms.end()) ms.erase(it); } cout << ms.size() << endl; }
codeforces
37
388
61682569
1000A
-1
cpp
Accepted
31
24,576
#include<stdio.h> #include<string> #include<map> #include<iostream> using namespace std; int main() { map<string,int> mp; int n; scanf("%d",&n); for(int i=0;i<n;i++) { string str; cin>>str; mp[str]++; } int m=n; for(int i=0;i<n;i++) { string str; cin>>str; if(mp[str]>0) { mp[str]--; m--; } } printf("%d\n",m); return 0; }
codeforces
37
388
39708288
1000A
-1
cpp
Accepted
31
20,480
#include <bits/stdc++.h> using namespace std; #define int long long int c,n,d; map<string,int> m1,m2; int32_t main() { cin>>n; string s; for(int i=0;i<n;i++){cin>>s;m1[s]++;} for(int i=0;i<n;i++){cin>>s;if(m1[s])m1[s]--;else m2[s]++;} for (map<string,int>::iterator it=m2.begin(); it!=m2.end(); ++it) c+=it->second; cout<<c<<endl; return 0; }
codeforces
37
389
39708288
1000A
-1
cpp
Accepted
31
20,480
#include <bits/stdc++.h> using namespace std; #define int long long int c,n,d; map<string,int> m1,m2; int32_t main() { cin>>n; string s; for(int i=0;i<n;i++){cin>>s;m1[s]++;} for(int i=0;i<n;i++){cin>>s;if(m1[s])m1[s]--;else m2[s]++;} for (map<string,int>::iterator it=m2.begin(); it!=m2.end(); ++it) c+=it->second; cout<<c<<endl; return 0; }
codeforces
37
389
39739638
1000A
-1
cpp
Accepted
15
8,192
#include<bits/stdc++.h> using namespace std; #define oo 1000000007 typedef long long ll; vector<ll>v; map<string ,int >m; int main() { int n; string s; cin>>n; for (int i=0;i<n;i++) { cin>>s; m[s]++; } int c=0; for (int i=0;i<n;i++) { cin>>s; if (m[s]==0) c++; else m[s]--; } cout<<c; }
codeforces
37
389
40189947
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<string > s1(n),s2(n); for(int i=0;i<n;i++){ cin>>s1[i]; } for(int i=0;i<n;i++){ cin>>s2[i]; } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(s1[i]==s2[j]){ s1[i]=s2[j]=""; break; } } } int ans=0; for(int i=0;i<n;i++){ if(s1[i]!="") ans++; } cout<<ans<<endl; return 0; }
codeforces
37
389
40938777
1000A
-1
cpp
Accepted
31
147,456
#include<bits/stdc++.h> using namespace std; multiset<string> s; int main () { string str; int n; cin>>n; for(int i =1;i<=n;i++) { cin>>str; s.insert(str); } multiset<string>::iterator it = s.begin(); for(int i= 1;i<=n;i++) { cin>>str; it = s.find(str); if(it != s.end()) s.erase(it); } cout<<s.size()<<endl; return 0 ; }
codeforces
37
389
41298028
1000A
-1
cpp
Accepted
31
307,200
#include<bits/stdc++.h> #define ll long long #define rep(i, j, k) for(int i=j; i<k; i++) using namespace std; const int maxn = 2e6; int n, ans; map<string, int> msi; int main(){ cin>>n; rep(i, 0, n){ string tmp; cin>>tmp; msi[tmp]++; ans++; } rep(i, 0, n){ string tmp; cin>>tmp; if (msi[tmp]){ msi[tmp]--; ans--; } } cout<<ans<<endl; }
codeforces
37
389
39713452
1000A
-1
cpp
Accepted
31
159,744
#include <iostream> #include <set> using namespace std; int main() { int n;cin>>n; multiset<string> a,b; for(int i=0;i<n;i++){ string s;cin>>s; a.insert(s); } for(int i=0;i<n;i++){ string s;cin>>s; b.insert(s); } int count=0; for(auto p:b){ for(auto q:a){ if(p==q){ count++; a.erase(a.find(q)); break; } } } cout<<n-count; }
codeforces
37
390
40500715
1000A
-1
cpp
Accepted
31
20,480
#include<stdio.h> #include<string> #include<string.h> #include<iostream> using namespace std; int main() { int i,n; scanf("%d",&n); int ans=n; string a[n],b; for(i=0;i<n;i++) cin>>a[i]; for(i=0;i<n;i++) { cin>>b; for(int j=0;j<n;j++) { if(a[j]==b) { a[j]="#"; ans--; break; } } } printf("%d\n",ans); return 0; }
codeforces
37
390
112307705
1000A
-1
cpp
Accepted
31
503,808
#include<bits/stdc++.h> using namespace std; int main() { int i,j,n,ans=0,flag; string a[10000],b[10000]; 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=1; for(j=0;j<n;j++) { if(b[i]==a[j]) { flag=0; a[j]='0'; break; } } if(flag) ans++; } cout<<ans<<endl; }
codeforces
37
390
40030522
1000A
-1
cpp
Accepted
31
16,384
#include<iostream> #include<map> using namespace std; map<string,int>counter; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ string huaji; cin>>huaji; counter[huaji]++; } for(int i=0;i<n;i++){ string huaji; cin>>huaji; counter[huaji]--; } int count=0; for(auto a=counter.begin();a!=counter.end();a++){ count+=abs(a->second); } cout<<count/2; }
codeforces
37
391
39706378
1000A
-1
cpp
Accepted
31
151,552
#include <bits/stdc++.h> using namespace std; int main() { vector<string > s; map<string,int > m1,m2; int n; cin>>n; for(int e=1;e<=n;e++) { string h; cin>>h; if(m1[h]==0) s.push_back(h); m1[h]+=1; } for(int e=1;e<=n;e++) { string h; cin>>h; m2[h]+=1; } int ans=0; for(int e=0;e<s.size();e++) if(m1[s[e]]>m2[s[e]]) ans+=m1[s[e]]-m2[s[e]]; cout<<ans; }
codeforces
37
392
39706378
1000A
-1
cpp
Accepted
31
151,552
#include <bits/stdc++.h> using namespace std; int main() { vector<string > s; map<string,int > m1,m2; int n; cin>>n; for(int e=1;e<=n;e++) { string h; cin>>h; if(m1[h]==0) s.push_back(h); m1[h]+=1; } for(int e=1;e<=n;e++) { string h; cin>>h; m2[h]+=1; } int ans=0; for(int e=0;e<s.size();e++) if(m1[s[e]]>m2[s[e]]) ans+=m1[s[e]]-m2[s[e]]; cout<<ans; }
codeforces
37
392
39759072
1000A
-1
cpp
Accepted
31
3,522,560
#include<iostream> #include<vector> #include<set> using namespace std; int main() { int n; multiset<string>s; // multiset<string>u; string t,v; cin >> n; for(int i=0 ; i<n ; i++){ cin>>t; s.insert(t); } for(int i=0 ; i<n ; i++){ cin>>v; if(s.find(v)!=s.end()) s.erase(s.find(v)); } cout<<s.size(); return 0; }
codeforces
37
392
40083588
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <unordered_map> using namespace std; int main() { int n; cin>>n; unordered_map<string, int>prev; for(int i=0; i<n; i++) { string x; cin>>x; prev[x]++; } int a = 0; for(int i=0; i<n; i++) { string y; cin>>y; if(prev[y] > 0) prev[y]--; else a++; } cout<<a<<"\n"; return 0; }
codeforces
37
392
86090749
1000A
-1
cpp
Accepted
31
3,883,008
#include<bits/stdc++.h> using namespace std; int n,x; string a[100],b[100],s; map<string,int> m1,m2; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin >> n; for(int i=0; i<2*n; i++){ cin >> s; if(i<n) m1[s]++; else m2[s]++; } for(auto it: m1) n-= min(it.second,m2[it.first]); cout << n; return 0; }
codeforces
37
392
39704458
1000A
-1
cpp
Accepted
31
151,552
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ios_base::sync_with_stdio(0); int n; cin>>n; multiset<string>s; for (int i = 0; i < n; ++i) { string x; cin>>x; s.insert(x); } int ans=0; for (int i = 0; i < n; ++i) { string x; cin>>x; auto it=s.find(x); if(it!=s.end()){ s.erase(it); } else ans++; } cout<<ans<<endl; return 0; }
codeforces
37
393
39943501
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> using namespace std; int main() { map < string,int > p; int n; cin >> n; for(int i=0; i<n; i++) { string x; cin >> x; p[x]++; } int ans = 0; for(int i=0; i<n; i++) { string x; cin >> x; if(p[x] > 0) p[x]--; else ans++; } cout << ans; return 0; }
codeforces
37
393
41610530
1000A
-1
cpp
Accepted
30
4,096
#include<cstdio> #include<iostream> #include<cstring> #include<string> #include<map> using namespace std; int main() { map<string,int> mp; string s; int n; cin>>n; int k = n; for(int i = 0; i < n; i++){ cin>>s; mp[s]++; } int ans = 0; for(int i = 0; i < k; i++){ cin>>s; if(mp[s]>0) mp[s]--; else ans++; } printf("%d\n", ans); return 0; }
codeforces
37
393
41758636
1000A
-1
cpp
Accepted
31
16,384
#include<bits/stdc++.h> using namespace std; string a[110],b[110]; map<string,int>cnt; int main(){ int n; cin>>n; cnt.clear(); for(int i=0;i<n;i++){ cin>>a[i]; cnt[a[i]]++; } for(int i=0;i<n;i++) cin>>b[i]; int ans=0; for(int i=0;i<n;i++){ if(cnt[b[i]]){ cnt[b[i]]--; ans+=0; } else{ ans+=1; } } cout<<ans<<endl; }
codeforces
37
393
46653360
1000A
-1
cpp
Accepted
31
12,288
#include<stdio.h> #include<string.h> char a[110][20],b[110][20]; int main() { int n,i,j,k=0; scanf("%d",&n); for(i=0;i<n;i++) scanf("%s",a[i]); for(i=0;i<n;i++) scanf("%s",b[i]); for(i=0;i<n;i++) for(j=0;j<n;j++) { if(a[i][0]&&strcmp(a[i],b[j])==0) { k++; memset(a[i],'\0',sizeof(a[i])); memset(b[j],'\0',sizeof(b[j])); } } printf("%d\n",n-k); return 0; }
codeforces
37
393
39707710
1000A
-1
cpp
Accepted
31
4,096
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; char a[105][10],s[105][10]; int vis[105]; memset(vis,0,sizeof(vis)); int num=n; for(int i=0;i<n;i++)cin>>a[i]; for(int i=0;i<n;i++){ cin>>s[i]; for(int j=0;j<n;j++){ if(strcmp(s[i],a[j])==0&&vis[j]==0){ num--; vis[j]=1; break; } } } cout<<num<<endl; return 0; }
codeforces
37
394
39758492
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #include <string> #include <map> #include <set> int N; std::map<std::string, int> ma; int main() { std::cin>>N; for (int i = 0; i < N; ++i) { std::string s; std::cin>>s; ma[s]++; } int ans = N; for (int i = 0; i < N; ++i) { std::string s; std::cin>>s; if (ma[s]) { ma[s]--; ans--; } } std::cout<<ans<<"\n"; return 0; }
codeforces
37
394
39786534
1000A
-1
cpp
Accepted
31
4,096
#include <iostream> #include <string> #include <map> using std::string; std::map<string, int> mp; int main() { int N, ans = 0; std::cin >> N; string ipt; for (int i = 0; i < N; i++) { std::cin >> ipt; mp[ipt] += 1; } for (int i = 0; i < N; i++) { std::cin >> ipt; if (mp[ipt] > 0) mp[ipt] --; else ans ++; } std::cout << ans << std::endl; }
codeforces
37
394
49181289
1000A
-1
cpp
Accepted
31
253,952
#include <cstdio> #include <cstring> #include <string> #include <map> #include <iostream> using namespace std; map < string, int > cnt; int n,m; int main(){ cin >> n; for ( int i = 0; i < n; i++ ){ string s; cin >> s; cnt[s] += 1; } int res = 0; for ( int i = 0; i < n; i++ ){ string s; cin >> s; if ( cnt[s] ) cnt[s]--; else res++; } printf("%d\n",res); return 0; }
codeforces
37
394
67440956
1000A
-1
cpp
Accepted
30
8,192
#include<bits/stdc++.h> using namespace std; int main() { int n,i,sum = 0; cin>>n; string s; map<string,int>m; for(i = 0; i < n; i++) { cin>>s; m[s]++; } for(i = 0; i < n; i++) { cin>>s; if(m[s]==0) sum++; else m[s]--; } cout<<sum<<endl; return 0; }
codeforces
37
394
72571796
1000A
-1
cpp
Accepted
30
20,480
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=200; int n,fa[N],fb[N],ans; string a[N],b[N]; int main(){ cin>>n; for(int i=1;i<=n;i++)cin>>a[i]; for(int i=1;i<=n;i++)cin>>b[i]; for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) if(a[i]==b[j]&&!fb[j]){fa[i]=fb[j]=1;break;} for(int i=1;i<=n;i++)if(!fa[i])ans++; cout<<ans; }
codeforces
37
394
39805318
1000A
-1
cpp
Accepted
31
106,496
#include <bits/stdc++.h> using namespace std; vector<string>ve1 , ve2; string s ; const int N =1e5+10; bool cha[N]; map<string , int>mp; int ans , n ; int main() { scanf("%d",&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; return 0; }
codeforces
37
395
43022621
1000A
-1
cpp
Accepted
31
335,872
#include <set> #include <map> #include <cstdio> #include <iostream> using namespace std; int n; map<string,int>mp; set<string>S; string s; int main() { cin>>n;int i,re=0; for(i=1;i<=n;i++){cin>>s;S.insert(s);mp[s]++;} for(i=1;i<=n;i++){cin>>s; if(mp[s]==1)S.erase(s); if(mp[s]>0)mp[s]--;} for(set<string>::iterator it=S.begin();it!=S.end();it++)re+=mp[*it]; printf("%d\n",re); }
codeforces
37
395
72569123
1000A
-1
cpp
Accepted
31
274,432
#include <iostream> #include <string> using namespace std; int main() { string s[105],a[105]; int n; cin>>n; int t=n; for(int i=0;i<n;i++) { cin>>s[i]; } for(int i=0;i<n;i++) { cin>>a[i];//cout<<a[i]<<" "; for(int j=0;j<n;j++) { //cout<<s[i]<<" "; if(s[j]!="pc"&&a[i]==s[j]) { t--; s[j]="pc"; break; } } } cout<<t; }
codeforces
37
395
72570049
1000A
-1
cpp
Accepted
31
4,096
#include <iostream> #include <cstring> #include <algorithm> #include <map> using namespace std; map<string, int> a; int n; int sum; 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; if (a[s]) a[s] --; else sum ++; } cout << sum << endl; }
codeforces
37
395
39730997
1000A
-1
cpp
Accepted
30
24,576
#include<iostream> #include<algorithm> #include<map> using namespace std; map <string, int> myMap; int main(){ int n, i, res=0; string x; cin>>n; for(i=0;i<n;i++){ cin>>x; myMap[x]++; } for(i=0;i<n;i++){ cin>>x; if(myMap[x] == 0){ res++; } else{ myMap[x]--; } } cout<<res<<endl; }
codeforces
37
396
49945074
1000A
-1
cpp
Accepted
30
151,552
#include <bits/stdc++.h> using namespace std; map<string, int> cnt1, cnt2; string s; int n, cnt; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> s; cnt1[s]++; } for (int i = 0; i < n; i++) { cin >> s; cnt2[s]++; } for (auto [x, y] : cnt1) cnt += min(y, cnt2[x]); return cout << n - cnt, 0; }
codeforces
37
396
49945074
1000A
-1
cpp
Accepted
30
151,552
#include <bits/stdc++.h> using namespace std; map<string, int> cnt1, cnt2; string s; int n, cnt; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> s; cnt1[s]++; } for (int i = 0; i < n; i++) { cin >> s; cnt2[s]++; } for (auto [x, y] : cnt1) cnt += min(y, cnt2[x]); return cout << n - cnt, 0; }
codeforces
37
396
52518007
1000A
-1
cpp
Accepted
46
8,192
#include <cstdio> #include <iostream> #include <algorithm> #include <map> #include <string> using namespace std; int m,n,ans; int a,b,c,d,e,f; map<string ,int> mp; string s1,s2; int main() { cin>>m; for(int x=0;x<m;x++) { cin>>s1; mp[s1]++; } for(int x=0;x<m;x++) { cin>>s2; if(mp[s2]>=1) { mp[s2]--; ans+=1; } } cout<<m-ans<<endl; }
codeforces
37
396
79666400
1000A
-1
cpp
Accepted
31
3,735,552
#include <bits/stdc++.h> using namespace std; #define ll long long int int main(){ map<int,vector<string>>m; ll n,c; cin>>n; c=n; string s; for(int i=0; i<n; i++){ cin>>s; m[s.size()].push_back(s); } while(n--){ cin>>s; int i=s.size(); for(auto x=m[i].begin();x!=m[i].end();x++) if(*x==s){ c--; m[i].erase(x); break; } } cout<<c; }
codeforces
37
396
127563471
1000A
-1
cpp
Accepted
31
3,743,744
#include<bits/stdc++.h> #include<map> #include<string> #include<cstdio> using namespace std; int main() { int n; string s; map<string, int>mm; cin >> n; for (int i = 0; i < n; i++) { cin >> s; mm[s]++; } int cnt = 0; for (int i = 0; i < n; i++) { cin >> s; if (mm[s] == 0) { cnt++; } else { mm[s]--; } } cout << cnt << endl; }
codeforces
37
396
39727139
1000A
-1
cpp
Accepted
30
12,288
#include <bits/stdc++.h> using namespace std; int main() { int n,i,c=0; string s; cin>>n; map<string,int>hash; for(i=0;i<n;i++) { cin>>s; if(hash.find(s)==hash.end()) { hash[s]=1; } else { hash[s]++; } } for(i=0;i<n;i++) { cin>>s; if(hash[s]) { hash[s]--; } else { c++; } } cout<<c; return 0; }
codeforces
37
397
42138825
1000A
-1
cpp
Accepted
31
8,192
#include<iostream> #include<string> #include<map> using namespace std; string ss; int book[105]; map<string,int> mp; int main(){ int n,m=1,ans=0; cin>>n; for(int i=0;i<n;i++){ cin>>ss; if(mp[ss]==0){mp[ss]=m;book[m++]=1;} else book[mp[ss]]++; } for(int i=0;i<n;i++){ cin>>ss; if(mp[ss]==0||book[mp[ss]]==0)ans++; else book[mp[ss]]--; }cout<<ans; return 0; }
codeforces
37
397
39706635
1000A
-1
cpp
Accepted
31
8,192
#include<iostream> #include<map> using namespace std; int main(){ int n; string s; cin >> n; map<string,int>m; for(int i=0;i<n;i++){ cin >> s; m[s]++; } int ans = 0; for(int i=0;i<n;i++){ cin >> s; if(m.find(s) == m.end() || !m[s]) ans++; else m[s]--; } cout << ans << endl; return 0; }
codeforces
37
398
39741164
1000A
-1
cpp
Accepted
30
294,912
#include <bits/stdc++.h> using namespace std; int main(){ int t,x; cin>>t; x=t; multiset<string> s1,s2; while(t--){ string n; cin>>n; s1.insert(n); } char s[1000]; for(int i = 0; i < x; i++){ scanf(" %s", s); auto it = s1.find(s); if(it != s1.end()) s1.erase(it); } cout<<s1.size(); }
codeforces
37
398
39742352
1000A
-1
cpp
Accepted
30
16,384
#include<bits/stdc++.h> using namespace std; int main() { int n,c=n; string s; int p; cin>>n; vector<string> v,b; for(int i=0;i<n;i++) { cin>>s; v.push_back(s); } for(int i=0;i<n;i++) { cin>>s; if(find(v.begin(),v.end(),s)!=v.end()) { p=find(v.begin(),v.end(),s)-v.begin(); v.erase(v.begin()+p); } else b.push_back(s); } cout<<b.size(); }
codeforces
37
398
39775060
1000A
-1
cpp
Accepted
30
4,096
#include<bits/stdc++.h> #include<iostream> #include<stack> using namespace std; int main() { int n; string a[105],b[105]; cin>>n; int l1=0; 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++) { int flag=0; for(int j=0;j<n;j++) { if(a[i]==b[j]) { flag=1; b[j]="0"; break; } } if(flag==0) { l1++; } } cout<<l1; }
codeforces
37
398
39803619
1000A
-1
cpp
Accepted
30
4,096
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define FOR(i,ii,iii)for(int i=ii;i<iii;i++) #define OUT(a)cout<<a<<endl #define PB push_back #define F first #define S second int n,res; map<string,int>m; string s; int main() { ios::sync_with_stdio(false); cin>>n; FOR(i,0,n)cin>>s,m[s]++; FOR(i,0,n){cin>>s;if(!m[s])res++;else m[s]--;} OUT(res); }
codeforces
37
398
61317017
1000A
-1
cpp
Accepted
31
12,288
#include<stdio.h> #include<iostream> using namespace std; int n,i,a[5][150],b[5][150],j; int main() { cin>>n; string s; for(i=0;i<n;i++) { cin>>s; a[s.size()][s[s.size()-1]]++; } for(i=0;i<n;i++) { cin>>s; b[s.size()][s[s.size()-1]]++; } for(i=0;i<5;i++) for(j=0;j<150;j++) if(a[i][j]&&b[i][j]) { n-=a[i][j]<b[i][j]?a[i][j]:b[i][j]; } cout<<n; }
codeforces
37
398
39706628
1000A
-1
cpp
Accepted
31
36,864
#include<bits/stdc++.h> using namespace std; long long n,m,i,j,ans,ans1,sum,p,fix[200],fix1[200]; string s[200],s1[200]; map<string, long long> ma; int main() { cin>>n; for(i=1;i<=n;i++) { cin>>s[i]; ma[s[i]]++; } for(i=1;i<=n;i++) { cin>>s1[i]; if(ma[s1[i]]>0) { ma[s1[i]]--; } else ans++; } cout<<ans<<endl; return 0; }
codeforces
37
399
39739486
1000A
-1
cpp
Accepted
15
151,552
#include <iostream> #include <cstring> #include <string> #include <cmath> #include <algorithm> #include <set> using namespace std; multiset <string> s; string x; int n, i; int main() { for (cin >> n, i = 0; i < n; i++) cin >> x, s.insert(x); for (i = 0; i < n; i++) { cin >> x; auto p = s.find(x); if (p != s.end()) s.erase(p); } cout << s.size(); return 0; }
codeforces
37
399
41412003
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; unordered_map<string,int> dp; int i=0; while(i<n){ string s; cin>>s; dp[s]++; i++; } i=0; int c=0; while(i<n){ string s; cin>>s; if(dp.find(s)==dp.end()){ c++; } else{ dp[s]--; if(dp[s]==0){ dp.erase(s); } } i++; } cout<<c<<endl; return 0; }
codeforces
37
399
45268062
1000A
-1
cpp
Accepted
31
4,096
#include <bits/stdc++.h> using namespace std; int ans; map<string,int>mp; int main() { int n; cin>>n; for(int i=0 ; i<n ; i++){ string str; cin>>str; mp[str]++; } for(int i=0 ; i<n ; i++){ string str; cin>>str; if(mp[str]<=0) ans++; mp[str]--; } cout<<ans<<endl; return 0; }
codeforces
37
399
69684878
1000A
-1
cpp
Accepted
30
4,096
#include<bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 int main() { ll n,ans=0; cin>>n; ans=n; string ch; map<string,ll>mp; for(ll i=0;i<n;i++){ cin>>ch; mp[ch]++; } for(ll i=0;i<n;i++){ cin>>ch; if(mp[ch]>0)ans--; mp[ch]--; } cout<<ans; return 0 ; }
codeforces
37
399
95305236
1000A
-1
cpp
Accepted
30
8,192
#include<bits/stdc++.h> using namespace std; int n,flag,ans,a[105]; string sd,st[105]; int main(){ scanf("%d",&n); for(int i=1; i<=n; i++)cin>>st[i]; for(int i=1; i<=n; i++){ cin>>sd; flag=1; for(int j=1; j<=n; j++){ if(a[j]==1)continue; if(sd.length()==st[j].length()&&sd==st[j]){ flag=0; a[j]=1; break; } } ans+=flag; } printf("%d",ans); }
codeforces
37
399
39707266
1000A
-1
cpp
Accepted
30
16,384
#include <bits/stdc++.h> using namespace std; const int N = 1e2 + 2; int n, ans; string s[N], b; map<string, int>cnt; int main() { cin >> n; for(int i = 0; i<n; i++) cin >> s[i]; for(int i = 0; i<n; i++) cin >> b, cnt[b]++; for(int i = 0; i<n; i++) if(cnt[s[i]]) cnt[s[i]]--; else ++ans; cout << ans; }
codeforces
37
400
39712040
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #include <string> using namespace std; bool used[100]; int main() { int n,removed=0; cin>>n; string p[101],t; for(int i=0;i<n;i++) cin>>p[i]; for(int i=0;i<n;i++) { cin>>t; for(int a=0;a<n;a++) { if( (!used[a]) && p[a].compare(t)==0 ){ removed++; used[a]=true; break; } } } cout<<n-removed; return 0; }
codeforces
37
400
39737070
1000A
-1
cpp
Accepted
31
16,384
#include <cstdio> #include <map> #include <string> #include <iostream> using namespace std; map <string, int> mp1, mp2; string a[105], b[105]; int main() { int n, i, ans; scanf("%d", &n); for(i = 0; i < n; i++) { cin >> a[i]; mp1[a[i]]++; } ans = 0; for(i = 0; i < n; i++) { cin >> b[i]; if(!mp1[b[i]]) ans++; else mp1[b[i]]--; } printf("%d\n", ans); return 0; }
codeforces
37
400
39752646
1000A
-1
cpp
Accepted
31
4,096
#include<bits/stdc++.h> using namespace std; int main(){ int n,count=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]; } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(a[i]==b[j]&&a[i]!=""){ a[i]=b[j]=""; count++; } } } cout << n-count << endl; return 0; }
codeforces
37
401
76767788
1000A
-1
cpp
Accepted
31
12,288
#include <iostream> #include <cstdio> #include <map> using namespace std; map<string,int> cnt; typedef long long ll; int n; int main() { scanf("%d",&n); for(int i=0;i<n;i++){ string tmp; cin>>tmp; cnt[tmp]++; } ll ans=0; while(n--){ string tmp; cin>>tmp; if(cnt[tmp]!=0){ cnt[tmp]--; } else{ ans++; } } printf("%lld\n",ans); return 0; }
codeforces
37
401
76767788
1000A
-1
cpp
Accepted
31
12,288
#include <iostream> #include <cstdio> #include <map> using namespace std; map<string,int> cnt; typedef long long ll; int n; int main() { scanf("%d",&n); for(int i=0;i<n;i++){ string tmp; cin>>tmp; cnt[tmp]++; } ll ans=0; while(n--){ string tmp; cin>>tmp; if(cnt[tmp]!=0){ cnt[tmp]--; } else{ ans++; } } printf("%lld\n",ans); return 0; }
codeforces
37
401
118193777
1000A
-1
cpp
Accepted
31
4,096
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e6 + 5; ll n, x, m, k; string s; map<string, ll> mp; int main() { cin >> n; for(int i = 1;i <= n;i++) { cin >> s; mp[s]++; } int ans = n; for(int i = 1;i <= n;i++) { cin >> s; if(mp[s]-- > 0) ans--; } cout << ans; return 0; }
codeforces
37
401
118193777
1000A
-1
cpp
Accepted
31
4,096
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e6 + 5; ll n, x, m, k; string s; map<string, ll> mp; int main() { cin >> n; for(int i = 1;i <= n;i++) { cin >> s; mp[s]++; } int ans = n; for(int i = 1;i <= n;i++) { cin >> s; if(mp[s]-- > 0) ans--; } cout << ans; return 0; }
codeforces
37
401
39759190
1000A
-1
cpp
Accepted
31
3,551,232
#include <iostream> using namespace std; int main(){ int t; cin >> t; string pr[t]; string cy[t]; for(int i=0;i<t;i++) cin >> pr[i]; for(int i=0;i<t;i++) cin >> cy[i]; int a[t]={0}; int i=0; for(int i =0;i<t;i++){ for(int j =0;j<t;j++) {if(cy[i]== pr[j] && a[j]==0) {a[j]=1; break;}} } int count= 0; for (int i=0;i<t;i++) { if(a[i]==0) count++; } cout << count; }
codeforces
37
402