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
39735263
1000A
-1
cpp
Accepted
30
155,648
#include<bits/stdc++.h> using namespace std; using ll=long long; int main() { ll n,m,i,j,k; multiset<string>v; cin>>n; string s; for(i=0;i<n;i++){ cin>>s;v.insert(s); } for(i=0;i<n;i++){ cin>>s; if(v.find(s)!=v.end())v.erase(v.find(s)); } cout<<v.size(); }
codeforces
37
333
40168748
1000A
-1
cpp
Accepted
31
16,384
#include<iostream> #include<cstdio> #include<map> using namespace std; map <string,int> pr; int num; string s; int main(){ pr.clear(); int ans = 0; cin >> num; for(int i = 0;i<num;i++){ cin >> s; pr[s]++; } for(int i = 0;i<num;i++){ cin >> s; if(pr[s] > 0) pr[s]--; else ans++; } cout << ans << endl; return 0; }
codeforces
37
333
39723581
1000A
-1
cpp
Accepted
30
12,288
#include <bits/stdc++.h> using namespace std; map<string,int>m; string s; int main() { int n; cin>>n; for(int i=1;i<=n;i++) { cin>>s; m[s]++; } for(int i=1;i<=n;i++) { cin>>s; m[s]--; } int ans=0; for(auto j:m) { if(j.second>0) ans+=j.second; } cout<<ans<<endl; return 0; }
codeforces
37
334
42107905
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; int main() { int n,ans=0; map<string,int> a; cin>>n; for(int i=0;i<n;i++){ string mid; cin>>mid; a[mid]++; } for(int i=0;i<n;i++){ string mid; cin>>mid; //cout<<mid<<" "<<a[mid]<<endl; if(a[mid]!=0){ ans++; a[mid]--; } } cout<<n-ans<<endl; return 0; }
codeforces
37
335
39708886
1000A
-1
cpp
Accepted
31
8,192
#include<iostream> using namespace std; int main() { int i,j,k,c=0,n;cin>>n; string s; string a[2*n]; for(i=0;i<2*n;i++) { cin>>s; a[i]=s; } for(i=0;i<n;i++) { for(j=n;j<2*n;j++) { if(a[i]==a[j] && a[i]!=" " && a[j]!=" ") { a[i]=" ";a[j]=" "; {c++;break;} } } } cout<<n-c; }
codeforces
37
337
72890226
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> using namespace std; int main() { string s1[101],str; int n,flag=0; cin>>n; for(int i=0;i<n;i++) cin>>s1[i]; for(int i=0;i<n;i++) { cin>>str; for(int i=0;i<n;i++) { if(str==s1[i]) { flag++; s1[i]='0'; break; } } } cout<<n-flag; return 0; }
codeforces
37
337
70794011
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; map<string,int> vis; int main(){ int n; cin>>n; string s; for(int i=0;i<n;i++) cin>>s,vis[s]++; int ans=0; for(int i=0;i<n;i++) { cin >> s; if (vis[s]) vis[s]--; else ans++; } cout<<ans<<endl; return 0; }
codeforces
37
339
77457452
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; map<string,int>m; string a[n]; string b[n]; for(int i=0;i<n;i++){ cin>>a[i]; m[a[i]]=m[a[i]]+1; } int count=0; for(int i=0;i<n;i++){ cin>>b[i]; if(m[b[i]]<1){ count++; } else{ m[b[i]]--; } } cout<<count; }
codeforces
37
339
112915186
1000A
-1
cpp
Accepted
15
20,480
#include<bits/stdc++.h> using namespace std; int n,k; string s[101],t[101]; map<string,int>m; void read(){ cin>>n; for(int i=0;i<n;i++)cin>>s[i],m[s[i]]++; for(int i=0;i<n;i++){ cin>>t[i]; if(m[t[i]])k++,m[t[i]]--; } } void solve(){ cout<<n-k; } int main(){ read(); solve(); }
codeforces
37
340
41589185
1000A
-1
cpp
Accepted
31
16,384
#include <bits/stdc++.h> using namespace std; int n,sec; string s; map <string,int> m1,m2; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin>>n; for(int i=0;i<n;i++){ cin>>s; m1[s]++; } for(int i=0;i<n;i++){ cin>>s; m2[s]++; } for (auto it : m1) n -= min(it.second, m2[it.first]); cout<<n<<endl; return 0; }
codeforces
37
341
39789565
1000A
-1
cpp
Accepted
31
147,456
#include<bits/stdc++.h> using namespace std; int main() { map<string,int> p,c; int n; cin>>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++) ++p[a[i]]; for(int i=0;i<n;i++) ++c[b[i]]; int ans=n; for (auto it : p) ans -=min(it.second,c[it.first]); cout<<ans; return 0; }
codeforces
37
342
39855686
1000A
-1
cpp
Accepted
46
12,288
#include <iostream> #include <map> using namespace std; map<string, int> was; int main() { int n; cin >> n; for(int i = 0; i < n; i++) { string s; cin >> s; was[s]++; } int ans = n; for(int i = 0; i < n; i++) { string s; cin >> s; if(was[s] > 0) was[s]--, ans--; } cout << ans << endl; return 0; }
codeforces
37
344
39706800
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; int main() { int i,j,k,n; cin>>n; vector<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<a.size();i++) for(j=0;j<b.size();j++) if(a[i]==b[j]) { a.erase(a.begin()+i); i=-1; b.erase(b.begin()+j); break; } cout<<a.size(); }
codeforces
37
344
47355166
1000A
-1
cpp
Accepted
30
24,576
#include<bits/stdc++.h> using namespace std; int n,ans; bool mark[200]; string s[200],ss; int main(){ cin>>n; for(int i=0;i<n;i++) cin>>s[i]; for(int i=0;i<n;i++){ cin>>ss; bool flag=false; for(int j=0;j<n;j++){ if(!mark[j] && s[j]==ss){ mark[j]=true; flag=true; break; } } if(!flag) ans++; } cout<<ans; }
codeforces
37
344
68091332
1000A
-1
cpp
Accepted
31
8,192
#include<iostream> #include<string> using namespace std; int main() { int n,j,f=0,arr[1000]={0}; cin>>n; string s[100],s1; for(int i=0;i<n;i++) { cin>>s[i]; } for(int i=0;i<n;i++) { cin>>s1; for(j=0;j<n;j++) { if(s1.compare(s[j])==0&&arr[j]==0){f++; arr[j]=1; break;} } } cout<<n-f<<endl; return 0; }
codeforces
37
344
39733191
1000A
-1
cpp
Accepted
30
24,576
#include<iostream> #include<bits/stdc++.h> using namespace std; map<string,int> m; int main() { int n; cin>>n; string pre[n],curr[n]; for(int i=0;i<n;i++) cin>>pre[i]; for(int i=0;i<n;i++) { cin>>curr[i]; m[curr[i]]++; } int c=0; for(int i=0;i<n;i++) { if(m[pre[i]]) { m[pre[i]]--; } else c++; } cout<<c<<endl; }
codeforces
37
345
39735573
1000A
-1
cpp
Accepted
30
20,480
#include <set> #include <iostream> using namespace std; int n,ans; multiset <string> v; int main() { cin>>n; for (int i=0;i<n;++i) { string s; cin>>s; v.insert(s); } for (int i=0;i<n;++i) { string s; cin>>s; auto x=v.find(s); if (x!=v.end()) v.erase(x); else ans++; } cout<<ans<<endl; return 0; }
codeforces
37
345
39757984
1000A
-1
cpp
Accepted
30
8,192
#include <bits/stdc++.h> using namespace std; int main(){ long long n,i,ans=0; cin >> n; string size; unordered_map<string,long long> prev; for(i=0 ;i<n ;i++){ cin >> size; prev[size]++; } for(i=0 ;i<n ;i++){ cin >> size; if (prev[size] != 0){ prev[size]--; } else{ ans ++; } } cout << ans << '\n'; return 0; }
codeforces
37
345
40635865
1000A
-1
cpp
Accepted
31
8,192
#include<iostream> #include<string> using namespace std; int main() { int n,i,j,x; string a[105],b[105]; cin>>n; x=n; for(i=0;i<n;i++) { cin.get(); cin>>a[i]; } for(i=0;i<n;i++) { cin.get(); cin>>b[i]; } for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(a[i]==b[j]) { b[j]='q'; x--; break; } } } cout<<x; }
codeforces
37
346
41080448
1000A
-1
cpp
Accepted
31
16,384
#include<cstdio> #include<map> #include<iostream> #include<string> using namespace std; int n,ans; string s; map <string,int> ma; int main() { scanf("%d",&n); for (int i=1;i<=n;++i) cin>>s,ma[s]++; for (int i=1;i<=n;++i) { cin>>s; if (ma[s]) ma[s]--; else ans++; } printf("%d",ans); return 0; }
codeforces
37
346
113391572
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> using namespace std; void solve(void) { int n; scanf("%d",&n); int ans=0; map<string,int>mp; for(int i = 0 ; i < n ; i++) { string s; cin>>s; mp[s]++; } for(int i = 0 ; i < n ; i++) { string s; cin>>s; if(mp[s]) mp[s]--; else ans++; } cout << ans; } signed main() { solve(); }
codeforces
37
347
113391572
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> using namespace std; void solve(void) { int n; scanf("%d",&n); int ans=0; map<string,int>mp; for(int i = 0 ; i < n ; i++) { string s; cin>>s; mp[s]++; } for(int i = 0 ; i < n ; i++) { string s; cin>>s; if(mp[s]) mp[s]--; else ans++; } cout << ans; } signed main() { solve(); }
codeforces
37
347
39723906
1000A
-1
cpp
Accepted
15
155,648
#include <bits/stdc++.h> using namespace std; int n,i,k,k1=0; multiset <string> st; string s; int main() { cin >> n; for(i=0;i<n;i++){ cin >> s; st.insert(s); } for(i=0;i<n;i++){ cin >> s; auto p = st.find(s); if(p != st.end()) st.erase(p); } cout <<st.size(); }
codeforces
37
348
39849789
1000A
-1
cpp
Accepted
31
4,096
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; 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]; } int ans=n; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(s1[i]==s2[j]) { s1[i]='\0'; s2[j]='\0'; ans--; break; } } } cout<<ans; }
codeforces
37
349
40414881
1000A
-1
cpp
Accepted
31
24,576
#include<iostream> #include<map> #include<string> using namespace std; int main() { int n,sum; string s; while(cin>>n) { sum=0; map<string,int>mapping; for(int i=0;i<n;i++) { cin>>s; mapping[s]++; } for(int i=0;i<n;i++) { cin>>s; if(mapping[s]) mapping[s]--; else sum++; } cout<<sum<<endl; } return 0; }
codeforces
37
349
39737723
1000A
-1
cpp
Accepted
31
20,480
#include<iostream> #include<algorithm> #include<map> using namespace std; map <string, int> me; int main() { int n, ans(0); cin >> n; for ( int i = 0; i < n; i++ ) { string f; cin >> f; me[f]++; } for ( int i = 0; i < n; i++ ) { string f; cin >> f; if (me[f] == 0) ans++; else me[f]--; } cout << ans; }
codeforces
37
350
39704841
1000A
-1
cpp
Accepted
15
4,096
#include <iostream> #include <map> #include <string> using namespace std; int n; string S; int main(){ cin >> n; map<string,int> m1,m2; for(int i=0;i<n;i++){ cin >> S; m1[S]++; } for(int i=0;i<n;i++){ cin >> S; m1[S]--; } int ans = 0; for(auto x:m1){ if(x.second>0) ans += x.second; } cout << ans << endl; }
codeforces
37
351
39873361
1000A
-1
cpp
Accepted
30
12,288
#include<iostream> #include<bits/stdc++.h> using namespace std; int cnt[5][200] ; int main() { int n; cin>> n; for(int i = 0; i < 2 * n; i++) { string s; cin>> s; cnt[s.size()][s.back()]+=(i<n?-1:1); } int ans = 0; for(int i = 0; i < 5; i++) for(int j = 0; j < 200; j++) ans += abs(cnt[i][j]); cout<< ans/2 << endl ; return 0; }
codeforces
37
351
39707137
1000A
-1
cpp
Accepted
31
151,552
#include <bits/stdc++.h> using namespace std; 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]; } for(auto& [x, y]: a) b[x]-=y; int res=0; for(auto& [x, y]: b) if (y>0) res+=y; cout<<res<<endl; }
codeforces
37
352
39710979
1000A
-1
cpp
Accepted
30
8,192
#include <bits/stdc++.h> using namespace std; int main() { int n,i,sum = 0; string s; map<string,int> a; cin>>n; for(i=0;i<n;i++){ cin>>s; a[s]++; } for(i=0;i<n;i++){ cin>>s; if(a[s]>0) a[s]--; } for(map<string,int>::iterator it = a.begin(); it!=a.end();++it) { sum+=it->second; } cout<<sum; return 0; }
codeforces
37
352
60316096
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> using namespace std; int main() { int i, ans = 0, n; cin>>n; char s[n+1][10]; map<string, int>mp; for(i = 0; i < n; i++)cin>>s[i],mp[s[i]]++; for(i = 0; i < n; i++) { cin>>s[i]; if(mp[s[i]])mp[s[i]]--; else ans++; } cout<<ans<<endl; return 0; }
codeforces
37
352
39705009
1000A
-1
cpp
Accepted
15
8,192
#include <bits/stdc++.h> using namespace std; map<string,int> mp; int main(){ int n; string s; 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]--; } int tot=0; for(auto a : mp) tot += a.second; cout<<tot; return 0; }
codeforces
37
353
39759246
1000A
-1
cpp
Accepted
31
3,379,200
#include<bits\stdc++.h> using namespace std; int main() { int n; cin >> n; map<string, int>mp; int ans = 0; string tmp; for (int i = 0; i < n; i++) { cin >> tmp; mp[tmp]++; } string tmp2; for (int i = 0; i < n; i++) { cin >> tmp2; if (mp[tmp2]) { mp[tmp2]--; continue; } ans++; } cout << ans; }
codeforces
37
353
40403708
1000A
-1
cpp
Accepted
31
4,096
#include <iostream> #include <map> #include<string > using namespace ::std; map <string, int> m1; map <string, int> m2; int main() { int n; cin >> n; int al = 0; for (int i = 0; i < n; i++) { string s; cin >> s; m1[ s]++; } for (int i = 0; i < n; i++) { string s; cin >> s; m1[s]--; if (m1[s] < 0) al++; } cout << al; }
codeforces
37
353
39817111
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #include <string> #include <map> using namespace std; int main(){ map<string,int> ct; int N; cin>>N; for(int i=0;i<N;i++){ string s; cin>>s; ct[s]++; } for(int i=0;i<N;i++){ string s; cin>>s; if(ct[s]) ct[s]--; } int m=0; for(auto i: ct){ m += i.second; } cout<<m<<endl; return 0; }
codeforces
37
354
49203197
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; int b=a; int c=a; map<string,int>ram; map<string,int>shyam; while(a--){ string p; cin>>p; ram[p]++; } int count=0; while(b--){ string p; cin>>p; if(ram[p]<0||!ram[p]){ count++; } else ram[p]--; } cout<<count<<endl; }
codeforces
37
354
39768838
1000A
-1
cpp
Accepted
30
4,096
#include <iostream> #include <map> using namespace std; int main() { int n, i; int res = 0; map <string, int> mass; string s; cin >> n; for (i = 0; i < n; i++) { cin >> s; mass[s] += 1; } for (i = 0; i < n; i++) { cin >> s; if (mass[s] > 0) mass[s] -= 1; else res += 1; } cout << res; return 0; }
codeforces
37
355
112114919
1000A
-1
cpp
Accepted
31
147,456
#include <iostream> #include <set> #include <string> using namespace std; int main() { int n; cin>>n; multiset<string> mt; string s; for(int i=0; i<n; i++) { cin>>s; mt.insert(s); } for(int i=0; i<n; i++){ cin>>s; auto pos=mt.find(s); if(pos!=mt.end()) mt.erase(pos); } cout<<mt.size(); return 0; }
codeforces
37
355
126070662
1000A
-1
cpp
Accepted
30
3,743,744
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; string s; map<string,int>mp; for(int i=1;i<=n;i++) { cin>>s; mp[s]++; } int ans=0; for(int i=1;i<=n;i++) { cin>>s; //cout<<mp[s]<<'\n'; if(mp[s]!=0) { //puts("#"); mp[s]--; ans++; } } cout<<n-ans; return 0; }
codeforces
37
355
40073295
1000A
-1
cpp
Accepted
30
8,192
#include <bits/stdc++.h> using namespace std; string str[110], str2[110]; map<string, int> mp; int main(void) { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> str[i]; mp[str[i]]++; } for (int i = 0; i < n; i++) { cin >>str2[i]; mp[str2[i]]--; } int ans = 0; for (auto m : mp) { ans += abs(m.second); } cout << ans/2 << endl; }
codeforces
37
356
39712751
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #include <string> using namespace std; int main() { int x,i,ii,r=0; cin>>x; string l[x],n[x]; for(i=0;i<x;i++) cin>>l[i]; for(i=0;i<x;i++) cin>>n[i]; for(i=0;i<x;i++) { for(ii=0;ii<x;ii++) { if(l[i]==n[ii]) { l[i]="A"; n[ii]="A"; } } } for(i=0;i<x;i++) { if(l[i]!="A") ++r; } cout<<r; }
codeforces
37
357
40303905
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; int main(){ int n; string p[100],c; cin>>n; for(int i=0;i<n;i++){ cin>>p[i]; } for(int i=0;i<n;i++){ cin>>c; for(int j=0;j<n;j++){ if(p[j]==c){ p[j]=""; break; } } } int cnt=0; for(int i=0;i<n;i++){ if(p[i]!="") cnt++; } printf("%d\n",cnt); return 0; }
codeforces
37
357
39714589
1000A
-1
cpp
Accepted
15
163,840
#include <bits/stdc++.h> using namespace std; int n; string a[111],b[111]; map <string,int> mp1,mp2; int main() { cin>>n; for (int i = 0;i<n;i++) cin>>a[i],mp1[a[i]]++; for (int j = 0;j<n;j++) cin>>b[j],mp2[b[j]]++; int ans = 0; for (auto i : mp2) ans += min(i.second,mp1[i.first]); ans = n - ans; cout<<ans; return 0; }
codeforces
37
358
39714589
1000A
-1
cpp
Accepted
15
163,840
#include <bits/stdc++.h> using namespace std; int n; string a[111],b[111]; map <string,int> mp1,mp2; int main() { cin>>n; for (int i = 0;i<n;i++) cin>>a[i],mp1[a[i]]++; for (int j = 0;j<n;j++) cin>>b[j],mp2[b[j]]++; int ans = 0; for (auto i : mp2) ans += min(i.second,mp1[i.first]); ans = n - ans; cout<<ans; return 0; }
codeforces
37
358
41540935
1000A
-1
cpp
Accepted
31
12,288
#include <iostream> using namespace std; int n=0,j,i,a[9]={0}; string x,y[9]= {"XXXS","XXS","XS","S","M","L","XL","XXL","XXXL"}; int main(){ cin>>n; for(i=0;i<n;i++) {cin>>x; for(j=0;j<9;j++) if(x==y[j]) {++a[j]; break;}} for(i=0;i<n;i++) {cin>>x; for(j=0;j<9;j++) if(x==y[j]) {--a[j]; break;}} n=0; for(i=0;i<9;i++) if(a[i]>0) n+=a[i]; cout<<n; return 0; }
codeforces
37
358
39705119
1000A
-1
cpp
Accepted
30
20,480
#include<bits/stdc++.h> using namespace std; typedef map<string,int>Map; int main() { int n,ans=0; Map mp1,mp2; string s; cin>>n; for(int i=1;i<=n;i++)cin>>s,mp1[s]++; for(int i=1;i<=n;i++)cin>>s,mp2[s]++; for(Map::iterator i=mp1.begin();i!=mp1.end();i++){ int num=min(i->second,mp2[i->first]); ans+=i->second-num; } cout<<ans<<endl; return 0; }
codeforces
37
360
39727945
1000A
-1
cpp
Accepted
31
20,480
#include <bits/stdc++.h> using namespace std; int main(void) { map<string,int> mp; int n; scanf("%d",&n); int ans=0; for(int i=0;i<n;i++) { string temp; cin>>temp; mp[temp]++; } for(int i=0;i<n;i++) { string temp; cin>>temp; mp[temp]--; } for(auto it:mp) ans+=max(0,it.second); printf("%d\n",ans); return 0; }
codeforces
37
360
39769663
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; string a[n],b[n]; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ cin>>b[i]; } int count = 0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(a[i]==b[j]){ count++; b[j]='qqqq'; break; } } } cout<<n-count<<endl; }
codeforces
37
360
59131954
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #include <cstdio> #include <cstring> #include <map> using namespace std; int main() { int n; map<string,int> m; scanf("%d",&n); string s; for(int i=0;i<n;i++){ cin>>s; m[s]++; } int sum=0; for(int i=0;i<n;i++){ cin>>s; if(m[s]) m[s]--; else sum++; } printf("%d\n",sum); return 0; }
codeforces
37
360
74271258
1000A
-1
cpp
Accepted
31
20,480
#include <bits/stdc++.h> using namespace std; typedef long long int lld; string a[111],b[111]; map<string,int> mm; int main(void){ int t; scanf("%d",&t); for(int e=0;e<t;e++){ cin >> a[e]; mm[a[e]]++; } int ans = 0; for(int e=0;e<t;e++){ cin >> b[e]; if(mm[b[e]]==0) ans++; else mm[b[e]]--; } cout << ans; return 0; }
codeforces
37
360
39707781
1000A
-1
cpp
Accepted
31
0
#include<cstdio> #include<cstring> int cnt,n; char s1[105][10],s2[105][10]; bool f[105]; int main() { scanf("%d",&n); for (int i=1;i<=n;i++)scanf("%s",s1[i]); for (int i=1;i<=n;i++)scanf("%s",s2[i]); for (int i=1;i<=n;i++) for (int j=1;j<=n;j++)if (!strcmp(s1[i],s2[j])&&!f[j]){ f[j]=1; cnt++; break; } printf("%d",n-cnt); }
codeforces
37
361
39723536
1000A
-1
cpp
Accepted
31
8,192
#include<iostream> #include<bits/stdc++.h> using namespace std; #define ll long long #define ld long double int main() { int n,i,res=0,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++) for(j=0;j<n;j++) if(a[i]==b[j]) {a[i]=b[j]="#";res++;break;} cout << n - res << "\n"; return 0; }
codeforces
37
361
39723536
1000A
-1
cpp
Accepted
31
8,192
#include<iostream> #include<bits/stdc++.h> using namespace std; #define ll long long #define ld long double int main() { int n,i,res=0,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++) for(j=0;j<n;j++) if(a[i]==b[j]) {a[i]=b[j]="#";res++;break;} cout << n - res << "\n"; return 0; }
codeforces
37
361
48710571
1000A
-1
cpp
Accepted
31
401,408
#include<bits/stdc++.h> using namespace std; int n; string str; multiset<string> s; int main() { scanf("%d", &n); for(int i = 0; i < n; i++) cin >> str, s.insert(str); for(int i = 0; i < n; i++) { cin >> str; auto pos = s.find(str); if(pos != s.end()) s.erase(pos); } printf("%d\n", s.size()); }
codeforces
37
361
39718056
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> using namespace std; int main() { int n=0,ans=0; string arr[100]; bool vis[100]={0}; cin>>n; for(int i=0;i<n;i++)cin>>arr[i]; for(int i=0;i<n;i++){ string str=""; cin>>str; for(int j=0;j<n;j++){ if(vis[j])continue; if(str==arr[j]){vis[j]=1;ans++;break;} } } cout<<n-ans; return 0; }
codeforces
37
362
39718056
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> using namespace std; int main() { int n=0,ans=0; string arr[100]; bool vis[100]={0}; cin>>n; for(int i=0;i<n;i++)cin>>arr[i]; for(int i=0;i<n;i++){ string str=""; cin>>str; for(int j=0;j<n;j++){ if(vis[j])continue; if(str==arr[j]){vis[j]=1;ans++;break;} } } cout<<n-ans; return 0; }
codeforces
37
362
52550887
1000A
-1
cpp
Accepted
30
8,192
#include<bits/stdc++.h> using namespace std; int n; map<string,int> t; string tmp; int ans=0; int main() { ios::sync_with_stdio(false); cin.tie(0); cin>>n; int nn=n; while(n--) { cin>>tmp; t[tmp]++; } while(nn--) { cin>>tmp; if(t[tmp])t[tmp]--; else ans++; } cout<<ans<<endl; }
codeforces
37
362
39713228
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> using namespace std; typedef long long LL; int n; map<string,int> M; const int N=111; string s[N]; int main(){ cin>>n; int ans=0; for(int i=0; i<n; i++){ cin>>s[i]; M[s[i]]++; } for(int i=0; i<n; i++) cin>>s[i]; for(int i=0; i<n; i++) if(M[s[i]]==0) ans++; else M[s[i]]--; cout<<ans<<endl; }
codeforces
37
363
39724195
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; int main() { //code 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]>0) mp[s]--; else ans++; } cout<<ans; return 0; }
codeforces
37
363
39876921
1000A
-1
cpp
Accepted
15
8,192
#include <bits/stdc++.h> using namespace std; int main () { int n, i, ans = 0; string s; map <string, int> m; scanf("%d", &n); for (i = 0; i < n; ++i) { cin >> s; m[s]++; } for (i = 0; i < n; ++i) { cin >> s; if (m[s] > 0) m[s]--; else ans++; } printf("%d", ans); return 0; }
codeforces
37
363
71135589
1000A
-1
cpp
Accepted
31
151,552
#include<bits/stdc++.h> using namespace std; signed main(){ int n; cin>>n; n=2*n; map<string,int>mp1; map<string,int>mp2; for(int i=1; i<=n; i++){ string s; cin>>s; if(i<=n/2) mp1[s]++; else mp2[s]++; } int ans=n/2; for(auto it: mp1){ //cout<< it.second <<endl; ans -= min(it.second, mp2[it.first]); } cout<<ans<<endl; return 0; }
codeforces
37
363
39704644
1000A
-1
cpp
Accepted
30
8,192
#include<bits/stdc++.h> using namespace std; map<string, int> a; int main() { int n; int num = 0; cin >> n; for (int i = 0; i < n; i++) { string tem; cin >> tem; a[tem]++; num++; } for (int i = 0; i < n; i++) { string tem; cin >> tem; if (a[tem] > 0) { a[tem]--; num--; } } cout << num << endl; return 0; }
codeforces
37
364
39705742
1000A
-1
cpp
Accepted
30
8,192
#include <iostream> #include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; set <string> s; map <string,int> m; for(int i=0;i<n;i++) { string q; cin>>q; s.insert(q); m[q]++; } int c=0; for(int i=0;i<n;i++) { string d; cin>>d; if(s.find(d)!=s.end() && m[d]>0) { c++; m[d]--; } } cout<<n-c<<endl; }
codeforces
37
365
39861090
1000A
-1
cpp
Accepted
30
311,296
#include<bits/stdc++.h> #define lli long long int using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int i,j,k,l,n,m,p,x,y,z,t; cin>>n; x=0; string s; map<string,int> a; for(i=0;i<n;i++) { cin>>s; a[s]++; } for(i=0;i<n;i++) { cin>>s; if(a[s]) { x++; a[s]--; } } cout<<n-x<<endl; return 0; }
codeforces
37
365
63559476
1000A
-1
cpp
Accepted
30
8,192
#include<bits/stdc++.h> using namespace std; int main() { int n,ans=0; string a[101],b[101]; cin>>n; for(int i=0;i<n;i++) cin >> a[i]; for(int i=0;i<n;i++) cin >> b[i]; sort(a,a+n); sort(b,b+n); for(int i=0;i<n;i++) for(int j=0;j<n;j++) if(a[i]==b[j]) { b[j]=-1; ans++; break; } cout<<n-ans; return 0; }
codeforces
37
365
39708034
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #include<bits/stdc++.h> using namespace std; int main() { unordered_map<string,int> m; int n; cin>>n; for(int i=0;i<n;i++) { string s; cin>>s; m[s]++; } int ans=0; for(int j=0;j<n;j++) { string s; cin>>s; if(m[s]>0) { ans++; m[s]--; } } cout<<n-ans; }
codeforces
37
367
71838609
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> using namespace std; string s; int n ; int top = 0; map<string , int>G; /* M S L xs xl xxs xxl xxxs xxxl */ int main(){ cin>>n; for(int i = 1; i <= n ; i++){ cin>>s; G[s]++; } for(int i = 1 ; i <= n ; i++){ cin>>s; if(G[s])G[s]--; else{ top++; } } cout<<top<<endl; return 0; }
codeforces
37
367
40214724
1000A
-1
cpp
Accepted
31
24,576
#include<bits/stdc++.h> using namespace std; map<string,int> mp; int main() { int n; cin >> n; string str; for(int i=0;i<n;i++){ cin >> str; mp[str]++; } int ans=0; for(int i=0;i<n;i++) { cin >> str; if(mp[str]<=0) ans++; mp[str]--; } printf("%d\n",ans); return 0; }
codeforces
37
368
46740292
1000A
-1
cpp
Accepted
30
4,096
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int ans = n; string s[105], s1[105]; 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){ for (int j = 0; j < n; ++j){ if (s[i] == s1[j]){ s1[j] = "-1"; --ans; j = n - 1; } } } cout << ans; }
codeforces
37
368
46838460
1000A
-1
cpp
Accepted
31
151,552
#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]; map<string,int> mapa,mapb; for(int i=0;i<n;i++) mapa[a[i]]++; for(int i=0;i<n;i++) mapb[b[i]]++; int ans = n; for (auto it : mapa) ans -= min(it.second, mapb[it.first]); cout << ans; }
codeforces
37
368
62848535
1000A
-1
cpp
Accepted
31
4,096
#include<bits/stdc++.h> using namespace std; int n,ans; map<string,int> m; map<string,int>::iterator it; int main(){ cin>>n; string str; for(int i=1;i<=n;i++) { cin>>str; m[str]++; } for(int i=1;i<=n;i++){ cin>>str; if(m[str]>0) m[str]--; } for(it=m.begin();it!=m.end();it++){ ans+=it->second; } cout<<ans; return 0; }
codeforces
37
368
39707963
1000A
-1
cpp
Accepted
15
8,192
#include <cstdio> #include <map> #include <cstring> #include <string> #define ll long long using namespace std; int main(){ int n,i,ans=0; map<string,int>mp; char x[10]; scanf("%d",&n); for (i=0; i<n; i++){ scanf("%s",&x); mp[x]++; } for (i=0; i<n; i++){ scanf("%s",&x); (!mp[x] ? ans++:mp[x]--); } printf("%d\n",ans); return 0; }
codeforces
37
369
40393211
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> #define rep(i,a,n) for(int i=a;i<n;i++) using namespace std; map<string,int>fuck; int main() { int n; cin>>n; string s; rep(i,1,n+1) { cin>>s; fuck[s]++; } int sum=0; rep(i,1,n+1) { cin>>s; if(fuck[s]) fuck[s]--; else sum++; } cout<<sum<<endl; return 0; }
codeforces
37
369
66965754
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; int main() { int n, i, j; cin>>n; string x; map<string, int>mp; for(i=0; i<n; i++) { cin>>x; mp[x]++; } for(i=0; i<n; i++) { cin>>x; mp[x]--; } int co=0; map<string, int>::iterator itr; for(itr=mp.begin(); itr!=mp.end(); itr++) co += max(0, itr->second); cout<<co; }
codeforces
37
369
39708295
1000A
-1
cpp
Accepted
30
16,384
#include<bits/stdc++.h> using namespace std; int ans,n,u2[201]; string a[201],b[201]; 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 (!u2[j] && a[i]==b[j]) { ans++,u2[j]=true; break; } } } cout<<n-ans; }
codeforces
37
370
39737438
1000A
-1
cpp
Accepted
31
159,744
#include<bits/stdc++.h> using namespace std; int main() { multiset<string>old; multiset<string>curr; int n; cin>>n; for(int i=0;i<n;i++) { string s; cin>>s; old.insert(s); } for(int i=0;i<n;i++) { string s; cin>>s; auto it=old.find(s); if(it!=old.end()) { old.erase(it); } else { curr.insert(s); } } cout<<old.size()<<"\n"; }
codeforces
37
370
39762646
1000A
-1
cpp
Accepted
31
3,371,008
#include<cstdio> #include<iostream> #include<map> #include<algorithm> #include<cstring> #include<string> #include<cmath> using namespace std; map<string,int> m; string st; int n,ans; int main(){ ans=0; cin>>n; for(int i=1;i<=n;i++){ cin>>st; m[st]++; } for(int i=1;i<=n;i++){ cin>>st; m[st]?m[st]--:ans++; } cout<<ans; return 0; }
codeforces
37
370
39782150
1000A
-1
cpp
Accepted
31
143,360
#include <bits/stdc++.h> using namespace std; multiset<string> s; int main() { int n; cin >> n; while (n--) { string startingSize; cin >> startingSize; s.insert(startingSize); } n = s.size(); for(int i = 0; i < n; i++){ string news; cin >> news; if(s.find(news) != s.end()) { s.erase(s.find(news)); } } cout << s.size() << endl; }
codeforces
37
370
39742049
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin>>n; map<string,int> m; for(long long i=0;i<n;i++) { string s; cin>>s; m[s]++; } int count=0; for(long long i=0;i<n;i++) { string s; cin>>s; if(m[s]==0) count++; else m[s]--; } cout<<count<<endl; return 0; }
codeforces
37
371
39746234
1000A
-1
cpp
Accepted
31
16,384
#include<stdio.h> #include<string.h> #include<iostream> #define Max 1000 //#include<vector> #include<map> using namespace std; map<string,int>m; int main(){ int n,i; string tmp; scanf("%d",&n); for(i=0;i<n;i++){ cin >> tmp; m[tmp]++; } int c = 0; for(i=0;i<n;i++){ cin >> tmp; if(m[tmp]>0) m[tmp]--; else c++; } printf("%d\n",c); return 0; }
codeforces
37
371
114721906
1000A
-1
cpp
Accepted
31
8,192
using namespace std; #include "bits/stdc++.h" int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr);cout.tie(nullptr); int n,cnt{};cin>>n;//bijection map<string,int> v; for(int i {};i<n;++i) {string s;cin>>s;++v[s];} for(int i {};i<n;++i) {string s;cin>>s;--v[s];} for(auto I:v) {if(I.second >= 0) cnt+=I.second;} cout << cnt; return 0; }
codeforces
37
371
39705243
1000A
-1
cpp
Accepted
15
24,576
#include<bits/stdc++.h> using namespace std; typedef long long int ll; const ll N=1e5+10; ll n,ans=0; string d; multiset <string> s; int main() { cin >> n; for(int i=1; i<=n; i++) { cin >> d; s.insert(d); } for(int i=1; i<=n; i++) { cin >> d; if(s.find(d)!=s.end()) s.erase(s.find(d)); } ans=(ll)s.size(); cout << ans; }
codeforces
37
372
39789293
1000A
-1
cpp
Accepted
30
12,288
#include <bits/stdc++.h> using namespace std; vector <string> a; map <string,int> mp; int main(){ int i,n; string k; cin >> n; for(i=0;i<n;i++){ cin >> k; a.push_back(k); } for(i=0;i<n;i++){ cin>> k; mp[k]++; } int ct=0; for(i=0;i<n;i++){ if(mp[a[i]]>0){ mp[a[i]]--; ct++; } } cout << n-ct; }
codeforces
37
372
39791340
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> using namespace std; const int MAXN = 6; map<string, int> mp; char s[MAXN]; int ans; int main() { int n; scanf("%d", &n); for(int i = 0; i < n; ++i) scanf("%s", s), ++mp[s]; for(int i = 0; i < n; ++i) scanf("%s", s), (mp[s] > 0 ? --mp[s] : ++ans); printf("%d\n", ans); return 0; }
codeforces
37
372
41091703
1000A
-1
cpp
Accepted
31
16,384
#include <bits/stdc++.h> using namespace std; int main(){ int n, temp, ans=0; string s; cin>>n; map<string, int> v; for (int i = 0; i < n; ++i){ cin>>s; v[s]++; } for (int i = 0; i < n; ++i){ cin>>s; if(v[s]>0) v[s]--; else ans++; } for (auto it = v.begin(); it != v.end(); ++it){ temp=it->second; ans+=temp; } cout<<(ans/2); return 0; }
codeforces
37
373
44772098
1000A
-1
cpp
Accepted
31
258,048
#include<bits/stdc++.h> using namespace std; map<string,int>mp; int main() { int n; scanf("%d",&n); string str; for(int i=1;i<=n;i++) { cin>>str; mp[str]++; } int ans=0; for(int i=1;i<=n;i++) { cin>>str; if(mp[str]) mp[str]--; else ans++; } printf("%d\n",ans); }
codeforces
37
373
63525607
1000A
-1
cpp
Accepted
30
8,192
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<map> using namespace std; map<string,int >mp; int main(){ int n; cin>>n; int sum=0; string str; for(int i=1;i<=n;i++) cin>>str,mp[str]++; for(int i=1;i<=n;i++){ cin>>str; if(mp[str]) mp[str]--; else sum++; } cout<<sum<<endl; return 0; }
codeforces
37
373
114125085
1000A
-1
cpp
Accepted
31
151,552
#include <bits/stdc++.h> using namespace std; int main() { map<string,int>a,b; int n;cin>>n; for(int i=0;i<n;i++){ string s;cin>>s; a[s]++; } int ans=n; for(int i=0;i<n;i++){ string s;cin>>s; b[s]++; } for(auto i:a){ ans-=min(i.second,b[i.first]); } cout<<ans; }
codeforces
37
373
39709529
1000A
-1
cpp
Accepted
15
8,192
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(false); map <string,int> m; int n; cin >> n; int ans = n; string k; for(int i = 0;i < n; ++i) cin >> k,m[k]++; for(int i = 0;i < n; ++i){ cin >> k; if(m[k] > 0){ ans--; m[k]--; } } cout << ans << endl; return 0; }
codeforces
37
374
39705227
1000A
-1
cpp
Accepted
31
12,288
#include <iostream> using namespace std; string s[105]; bool used[105]; int main() { int n; cin >> n; for (int i=0;i<n;i++) cin >> s[i]; int ans=n; for (int i=0;i<n;i++) { string a; cin >> a; for (int x=0;x<n;x++) { if (used[x]) continue; if (a==s[x]) { used[x]=1; ans--; break; } } } cout << ans; }
codeforces
37
375
40027660
1000A
-1
cpp
Accepted
31
307,200
#include<bits/stdc++.h> using namespace std; const int N=105; int n,ans=0; string s; map<string,int> mp; int type(string s){ if(s=="XXXL")return 1; if(s=="XXL")return 2; } int main(){ scanf("%d",&n); for(int i=1;i<=n;i++)cin >> s,mp[s]++; for(int i=1;i<=n;i++){ cin >> s; if(mp[s])mp[s]--; else ans++; } printf("%d\n",ans); return 0; }
codeforces
37
375
40027660
1000A
-1
cpp
Accepted
31
307,200
#include<bits/stdc++.h> using namespace std; const int N=105; int n,ans=0; string s; map<string,int> mp; int type(string s){ if(s=="XXXL")return 1; if(s=="XXL")return 2; } int main(){ scanf("%d",&n); for(int i=1;i<=n;i++)cin >> s,mp[s]++; for(int i=1;i<=n;i++){ cin >> s; if(mp[s])mp[s]--; else ans++; } printf("%d\n",ans); return 0; }
codeforces
37
375
40865342
1000A
-1
cpp
Accepted
30
8,192
#include <iostream> #include <map> #include <string> using namespace std; int main() { string temp; map<string, int>mp; int m, ans = 0; cin >> m; for (int i = 0; i < m; i++) cin >> temp, mp[temp]++;; for (int i = 0; i < m; i++) { cin >> temp; if (mp[temp])mp[temp]--; else ans++; } cout << ans << endl; // system("pause"); return 0; }
codeforces
37
375
76291503
1000A
-1
cpp
Accepted
31
16,384
#include <bits/stdc++.h> using namespace std; int n, ans; string s; map <string, int> m; int main() { ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); cin >> n; for (int i = 0; i < n; i++) cin >> s, m[s]++; for (int i = 0; i < n; i++) { cin >> s; m[s] ? m[s]-- : ans++; } cout << ans << endl; return 0; }
codeforces
37
375
39784052
1000A
-1
cpp
Accepted
31
4,096
#include <iostream> #include <bits/stdc++.h> #define ll long long #define ull unsigned long long using namespace std; int main(){ int n,c=0,m; cin >>n; m=n*2; string arr[m]; for(int i=0;i<m;i++){ cin >>arr[i]; } for(int i=0;i<n;i++){ for(int j=n;j<m;j++){ if(arr[j]==arr[i]){c++;arr[j]="aa";break;} } } cout<<n-c<<endl; return 0; }
codeforces
37
376
39848744
1000A
-1
cpp
Accepted
31
16,384
#include<iostream> #include<map> #include<cstring> #include<string> using namespace std; int main() { int n,m,i,cnt; string s; while(cin>>n) { m=n; map<string,int>mp; while(m--) { cin>>s; mp[s]++; } cnt=0; while(n--) { cin>>s; if(mp[s]==0) cnt++; else mp[s]--; } cout<<cnt<<endl; } return 0; }
codeforces
37
376
41738109
1000A
-1
cpp
Accepted
31
20,480
#include<iostream> using namespace std; struct shirt{ string x; }; int main(){ int n; cin>>n; shirt pre[n]; shirt cur[n]; int ans=n; for(int i=0;i<n;i++) cin>>pre[i].x; for(int i=0;i<n;i++) cin>>cur[i].x; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(cur[i].x==pre[j].x){ ans--; cur[i].x="AAA"; pre[j].x="BBB"; } } } cout<<ans; }
codeforces
37
377
67387467
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; int main() { string x; int tc,i,cnt=0; cin>>tc; map<string,int>mp; for(i=0;i<tc;i++) { cin>>x; mp[x]++; } for(i=0;i<tc;i++) { cin>>x; if(mp[x]>0) mp[x]--; else cnt++; } cout<<cnt; }
codeforces
37
377
39794238
1000A
-1
cpp
Accepted
31
147,456
#include <bits/stdc++.h> using namespace std; int n, ans; multiset<string> a; string b; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; ans = n; for(int i = 0; i < n; i++) { cin >> b; a.insert(b); } for(int i = 0; i < n; i++) { cin >> b; if(a.find(b) != a.end()) { a.erase(a.find(b)); ans--; } } cout << ans; }
codeforces
37
378
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