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
39811802
1000A
-1
cpp
Accepted
31
12,288
#include <iostream> #include <map> using namespace std; map <string,int> mp; string a[9]={"S","L","M","XS","XL","XXS","XXL","XXXS","XXXL"}; int main(int argc, char *argv[]) { int n; string s; int ans=0; cin>>n; for(int i=1;i<=n;i++) cin>>s,mp[s]++; for(int i=1;i<=n;i++) cin>>s,mp[s]--; for(int i=0;i<9;i++) { if(mp[a[i]]>0) ans+=mp[a[i]]; } cout<<ans<<endl; return 0; }
codeforces
37
402
41269585
1000A
-1
cpp
Accepted
15
303,104
#include<iostream> #include<string> #include<set> using namespace std; int main() { int n; string str; multiset<string>s; while (cin >> n) { for (int i = 1; i <= n; i++) { cin >> str; s.insert(str); } for (int i = 1; i <= n; i++) { cin >> str; if (s.find(str) != s.end()) s.erase(s.find(str)); } cout << s.size() << endl; } return 0; }
codeforces
37
402
116239643
1000A
-1
cpp
Accepted
31
8,192
#include<iostream> #include<map> using namespace std; map<string,int> m; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ string s; cin>>s; m[s]++; } for(int i=1;i<=n;i++){ string s; cin>>s; if(m[s]>0) m[s]--; } int ans=0; for(auto a:m){ ans+=a.second; } cout<<ans<<endl; }
codeforces
37
402
39707991
1000A
-1
cpp
Accepted
15
12,288
#include<bits/stdc++.h> using namespace std; int main() { int n,count=0; cin>>n; string s; string arr[n]; for(int i=0;i<n;i++) cin>>arr[i]; for(int i=0;i<n;i++) { int flag=1; cin>>s; for(int i=0;i<n;i++) { if(s.compare(arr[i])==0) { arr[i]=" "; flag=0; break; } } if(flag) count++; } cout<<count; return 0; }
codeforces
37
403
39736217
1000A
-1
cpp
Accepted
15
12,288
#include <iostream> #include <string> #include <map> using namespace std; int main() { #ifdef local freopen("input.txt","r",stdin); #endif // local int n; cin >> n; string s; map<string, int> mp; for (int i = 0; i < n; i++){ cin >> s; mp[s]++; } int cnt = 0; for (int i = 0; i < n; i++){ cin >> s; mp[s] ? mp[s]-- : cnt++; } cout << cnt << endl; return 0; }
codeforces
37
403
72572284
1000A
-1
cpp
Accepted
30
155,648
#include<iostream> #include<map> using namespace std; int n,cnt; string s[110],str; map<string,int>m1,m2; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>s[i]; m1[s[i]]++; } for(int i=1;i<=n;i++){ cin>>str; if(!m1[str]) cnt++; else m2[str]++; } for(int i=1;i<=n;i++){ if(m2[s[i]]-m1[s[i]]>0){ cnt+=m2[s[i]]-m1[s[i]]; m2[s[i]]=-1; } } cout<<cnt; }
codeforces
37
403
112061438
1000A
-1
cpp
Accepted
30
32,768
#include<bits/stdc++.h> using namespace std; int main(){ int n,count=0; cin>>n; string a[n]; int a1[n]={0}; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n;i++){ int sign=0; string s; cin>>s; for(int j=0;j<n;j++){ if(s==a[j]&&a1[j]==0){ sign=1; a1[j]=1; break; } } if(sign==0){ count++; } } cout<<count<<endl; return 0; }
codeforces
37
403
39704766
1000A
-1
cpp
Accepted
30
16,384
#include <bits/stdc++.h> using namespace std; map<string, int> p; char str[122][30]; int main() { int n; scanf("%d", &n); for(int i = 0; i < n; i++) { scanf("%s", str[i]); p[str[i]]++; } char s[100]; int num = 0; for(int i = 0; i < n; i++) { scanf("%s", s); if(p[s]) p[s]--; else num++; } printf("%d\n", num); }
codeforces
37
404
39705059
1000A
-1
cpp
Accepted
31
16,384
#include <bits/stdc++.h> using namespace std; const int inf=1e2+9; string a[inf]; string b[inf]; map<string ,int> mp; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; mp[a[i]]++; } vector <string> v; for(int i=0;i<n;i++){ cin>>b[i]; if(mp[b[i]]){ mp[b[i]]--; } else { v.push_back(b[i]); } } cout<<v.size()<<endl; }
codeforces
37
404
39713791
1000A
-1
cpp
Accepted
31
20,480
#include <bits/stdc++.h> using namespace std; int main() { pair <string, int> p; vector < pair <string, int>> v; map <string, int> mp; int n, cntr{0}; 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) cntr++; if (mp[s] > 0) mp[s]--; } cout << cntr << endl; return 0; }
codeforces
37
404
39729648
1000A
-1
cpp
Accepted
15
12,288
#include<bits/stdc++.h> using namespace std; int main(){ int num; cin>>num; string str1[101],str2[101]; for(int i=0;i<num;i++){ cin>>str1[i];} for(int j=0;j<num;j++){ cin>>str2[j];} int count=0; for(int i=0;i<num;i++){ for(int j=0;j<num;j++){ if(str1[i] == str2[j]){count ++;str2[j]= "abc";break;} } } cout<<num-count<<endl; }
codeforces
37
404
72557903
1000A
-1
cpp
Accepted
31
8,192
#include <cstdio> #include <map> #include <string> #include <iostream> #include <algorithm> using namespace std; map <string, int> mp; int main(){ int n, ans = 0; string a; cin >> n; int nn = n; while(nn--){ cin >> a; mp[a]++; } nn = n; while(nn--){ cin >> a; if(mp[a]){ mp[a]--; continue; } else ans++; } cout << ans << endl; return 0; }
codeforces
37
404
39704455
1000A
-1
cpp
Accepted
15
12,288
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back map<string,int>mp; int main(){ ios::sync_with_stdio(false); int n; cin>>n; for (int i=0;i<n;i++){ string s; cin>>s; mp[s]++; } int cnt=0; for (int i=0;i<n;i++){ string s; cin>>s; if (mp[s]>0){ mp[s]--; }else{ cnt++; } } cout<<cnt<<endl; }
codeforces
37
405
40714795
1000A
-1
cpp
Accepted
31
24,576
#include<iostream> using namespace std; int A[4][3]; int M[256]; int main() { M['M']=0; M['L']=1; M['S']=2; int n,x,t=0; string s; cin>>n; for(x=0;x<n;x++) { cin>>s; A[s.size()-1][M[s[s.size()-1]]]++; } for(x=0;x<n;x++) { cin>>s; if(A[s.size()-1][M[s[s.size()-1]]]) A[s.size()-1][M[s[s.size()-1]]]--; else t++; } cout<<t<<endl; return 0; }
codeforces
37
405
40714813
1000A
-1
cpp
Accepted
31
24,576
#include<iostream> using namespace std; int A[4][3]; int M[256]; int main() { M['M']=0; M['L']=1; M['S']=2; int n,x,t=0; string s; cin>>n; for(x=0;x<n;x++) { cin>>s; A[s.size()-1][M[s[s.size()-1]]]++; } for(x=0;x<n;x++) { cin>>s; if(A[s.size()-1][M[s[s.size()-1]]]) A[s.size()-1][M[s[s.size()-1]]]--; else t++; } cout<<t<<endl; return 0; }
codeforces
37
405
70733698
1000A
-1
cpp
Accepted
31
8,192
#include<iostream> #include<map> using namespace std; #define de(x) cout<<#x<<" = "<<x<<endl map<string,int>mp; int main(){ int n; cin>>n; string s; for(int i=1;i<=n;i++){ cin>>s; mp[s]++; } int cnt=0; for(int i=1;i<=n;i++){ cin>>s; if(mp[s]!=0) mp[s]--; else cnt++; } cout<<cnt; return 0; }
codeforces
37
405
88066902
1000A
-1
cpp
Accepted
31
3,731,456
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; int ans = 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]) { m[s]--; ans --; } } cout << ans; }
codeforces
37
405
39704459
1000A
-1
cpp
Accepted
15
8,192
#include <bits/stdc++.h> using namespace std; #define IO ios_base::sync_with_stdio(0);cin.tie(0); int main() { IO; int n; cin >> n; map <string, int> m; for (int i = 0; i < n; ++i) { string s; cin >> s; m[s]++; } for (int j = 0; j < n; ++j) { string t; cin >> t; if (m[t] > 0) m[t]--; } int sum = 0; for (auto elem : m) sum += elem.second; cout << sum << endl; return 0; }
codeforces
37
406
39710936
1000A
-1
cpp
Accepted
15
12,288
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; string a[n],b[n]; unordered_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++) { cin>>b[i]; if(mp.find(b[i])!=mp.end() && mp[b[i]]>0) mp[b[i]]--; else { ans++; } } cout<<ans; return 0; }
codeforces
37
406
39746866
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; #define ll long long #define f(i,n) for(int i=0;i<n;i++) int main() { int n; cin>>n; string s,b[n]; map<string,ll>m; for(int i=0;i<n;i++) { cin>>s; m[s]++; } for(int i=0;i<n;i++) { cin>>b[i]; } int count=0; for(int i=0;i<n;i++) { if(m[b[i]]>0) m[b[i]]--; else count++; } cout<<count; }
codeforces
37
406
108981995
1000A
-1
cpp
Accepted
15
0
#include <stdio.h> #include <string.h> char x[110]; int count[110][110]; int main() { int a; scanf("%d",&a); for(int i=1;i<=a;i++) { scanf("%s",x+1); int b = strlen(x+1); count[b-1][x[b]-'A']++; } int ans = 0; for(int i=1;i<=a;i++) { scanf("%s",x+1); int b = strlen(x+1); if(count[b-1][x[b]-'A']>=1) count[b-1][x[b]-'A']--; else ans++; } printf("%d",ans); }
codeforces
37
406
39705955
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> typedef long long ll; using namespace std; ll n; string y; ll t=0; int main(){ cin>>n; vector<string> pr(n); for(int i=0;i<n;i++){ cin>>pr[i]; } for(int i=0;i<n;i++){ cin>>y; vector<string>::iterator it; if ((it=find(pr.begin(),pr.end(),y))!=pr.end())pr.erase(it); else t++; } cout<<t; }
codeforces
37
407
39859744
1000A
-1
cpp
Accepted
31
307,200
#include <bits/stdc++.h> using namespace std; typedef long long LL; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; string s; map<string, int> ty, ny; cin >> n; for (int i = 0; i < n; ++i) { cin >> s; ty[s] += 1; } for (int i = 0; i < n; ++i) { cin >> s; ny[s] += 1; } int ans = 0; for (auto P: ty) ans += min(P.second, ny[P.first]); cout << n -ans << '\n'; }
codeforces
37
407
39712639
1000A
-1
cpp
Accepted
30
815,104
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll,ll> pii; #define REP(i,n) for(int i=0;i<n;i++) #define MX 100000 ll a[MX]; int main() { int n; cin>>n; string t; int total=n; map<string,int> f; REP(i,n) cin>>t,f[t]++; REP(i,n) { cin>>t; if(f[t]!=0) f[t]--,total--; } cout<<total<<endl; return 0; }
codeforces
37
408
39712639
1000A
-1
cpp
Accepted
30
815,104
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll,ll> pii; #define REP(i,n) for(int i=0;i<n;i++) #define MX 100000 ll a[MX]; int main() { int n; cin>>n; string t; int total=n; map<string,int> f; REP(i,n) cin>>t,f[t]++; REP(i,n) { cin>>t; if(f[t]!=0) f[t]--,total--; } cout<<total<<endl; return 0; }
codeforces
37
408
40653775
1000A
-1
cpp
Accepted
31
0
#include<stdio.h> #include<string.h> int main() { int n,i,s=0,j; char size1[1001][10],size2[1001][10]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%s",size1[i]); } for(i=0;i<n;i++) { scanf("%s",size2[i]); } for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(strcmp(size1[i],size2[j])==0) { s++; size1[i][0]='z'; size2[j][0]='z'; break; } } } printf("%d",n-s); return 0; }
codeforces
37
408
67503035
1000A
-1
cpp
Accepted
30
8,192
#include <bits/stdc++.h> using namespace std; #define int long long int int32_t 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] && a[i] != ""){ b[j] = ""; a[i] = b[j]; count++; } } } cout << n - count << endl; return 0; }
codeforces
37
408
69618090
1000A
-1
cpp
Accepted
31
12,288
/*input 2 M XS XS M */ #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); int n; cin >> n; map<string, int> mp; string s; for(int i = 0; i < n; i++) { cin >> s; mp[s]++; } int ans = 0; for(int i = 0; i < n; i++) { cin >> s; if(mp[s]) mp[s]--; else ans++; } cout << ans << '\n'; return 0; }
codeforces
37
409
39707413
1000A
-1
cpp
Accepted
31
20,480
#include<bits/stdc++.h> using namespace std; int n,cnt=0; string a[105],b[105]; int main(){ cin>>n; for(int i=1;i<=n;++i)cin>>a[i]; for(int i=1;i<=n;++i)cin>>b[i]; sort(a+1,a+n+1); sort(b+1,b+n+1); int h1=1,h2=1; while(h1<=n&&h2<=n){ while(a[h1]<b[h2]&&h1<=n)++h1; while(b[h2]<a[h1]&&h2<=n)++h2; if(a[h1]==b[h2])++cnt,++h1,++h2; else ++h1; } printf("%d",n-cnt); return 0; }
codeforces
37
410
39757372
1000A
-1
cpp
Accepted
30
8,192
#include<stdio.h> #include<iostream> #include<string> #include<map> using namespace std; int n; map<string, int> mp; int main() { int res = 0; string input; cin >> n; for (int i = 0; i < n; i++) { cin >> input; mp[input]++; } for (int i = 0; i < n; i++) { cin >> input; if (mp[input] > 0) mp[input]--; else { res++; } } printf("%d\n", res); return 0; }
codeforces
37
410
39864460
1000A
-1
cpp
Accepted
31
299,008
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; int res = n; string a[101]; string stmp; for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < n; ++i) { cin >> stmp; for (int j = 0; j < n; ++j) { if (stmp == a[j]) { a[j] = ""; --res; break; } } } cout << res; return 0; }
codeforces
37
410
39709548
1000A
-1
cpp
Accepted
30
8,192
#include <iostream> #include<bits/stdc++.h> #include<string.h> #include<map> using namespace std; int main() { int n; map <string, int> mymap; cin>>n; string b; int a =n; while(a--){ cin>>b; if (mymap[b] == 0) mymap[b]=1; else mymap[b]++; } a=n; int ans=0; while(a--){ cin>>b; if (mymap[b] == 0){ ans++; } else mymap[b]--; } cout<<ans<<endl; }
codeforces
37
411
39715783
1000A
-1
cpp
Accepted
31
12,288
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll n, r; char tmp[20]; string wa; map<string, ll> d; int main() { scanf("%lld", &n); for (ll i = 0; i < n; i++) scanf("%s", tmp), wa = tmp, d[wa]++; for (ll i = 0; i < n; i++) { scanf("%s", tmp), wa = tmp; if (d[wa]) d[wa]--; else r++; } printf("%lld\n", r); return 0; }
codeforces
37
411
39734329
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> using namespace std; int main(){ int i,j,k,n,m,count=0; cin>>n; string s; vector<string>a,b; for(i=0;i<n;i++){ cin>>s; a.push_back(s); } for(i=0;i<n;i++){ cin>>s; b.push_back(s); } int arr[n]={0}; for(i=0;i<n;i++){ s=b[i]; for(j=0;j<n;j++){ if(a[j]==s&&arr[j]==0){ arr[j]=1; count++; break; } } } cout<<n-count; }
codeforces
37
411
39866858
1000A
-1
cpp
Accepted
30
8,433,664
#include <bits/stdc++.h> #define F first #define S second using namespace std; typedef long long ll; const int MX=3e5+9; int n,vis[MX]; string s[MX],s1; int main(){ cin>>n; for(int i=0;i<n;i++)cin>>s[i]; int sum=n; for(int i=0;i<n;i++){ cin>>s1; for(int j=0;j<n;j++){ if(vis[j])continue; if(s1==s[j]){ vis[j]=1; sum--; break; } } } cout<<sum<<endl; }
codeforces
37
411
54503584
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #include <map> #include <string> using namespace std; map<string, int> M; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; string s; 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[s]) { M[s]--; } else { ans++; } } cout << ans; }
codeforces
37
411
76675309
1000A
-1
cpp
Accepted
30
16,384
#include <bits/stdc++.h> using namespace std; const int N = 120; int main() { int n, cnt = 0; string s1[N], s2[N]; cin >> 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] != "0") { s1[i] = "0", s2[j] = "0"; cnt++; } cout << n - cnt; }
codeforces
37
411
39723563
1000A
-1
cpp
Accepted
30
8,192
#include <iostream> #include <map> using namespace std; int main(){ int n,ct=0,l; cin>>n; string s; map<string,int> m; for(int i=0;i<n;i++){ cin>>s; m[s]++; } for(int i=0;i<n;i++){ cin>>s; m[s]--; } for(auto it=m.begin();it!=m.end();it++){ if(it->second >0){ ct+=it->second; } } cout<<ct; }
codeforces
37
412
69021267
1000A
-1
cpp
Accepted
31
4,096
#include "bits/stdc++.h" using namespace std; int main() { int n; cin >> n; map<string, int> occ; for (int i=0; i<n; i++) { string s; cin >> s; occ[s]++; } for (int i=0; i<n; i++) { string s; cin >> s; occ[s]--; } int t = 0; for (map<string, int>::iterator x=occ.begin(); x!=occ.end(); x++) { if (x->second > 0) t += x->second; } cout << t << endl; }
codeforces
37
412
39708508
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; map<string,int> hash_; string s[n],s1[n]; for(int i=0;i<n;i++) { cin>>s[i]; hash_[s[i]]++; } int cnt=0; for(int i=0;i<n;i++) { cin>>s1[i]; if(hash_[s1[i]]==0) cnt++; else hash_[s1[i]]--; } cout<<cnt; }
codeforces
37
413
39735055
1000A
-1
cpp
Accepted
15
8,192
#include <bits/stdc++.h> using namespace std; int main() { map<string,int> m; int n; cin>>n; for(int i=0; i<n; i++) { string s; cin>>s; m[s]++; } for(int i=0; i<n; i++) { string s; cin>>s; m[s]--; } map<string,int>:: iterator it; int ans=0; for(it=m.begin(); it!=m.end(); it++) { int t = it->second; if(t>0) ans+=t; //cout } cout<<ans<<endl; }
codeforces
37
413
40104182
1000A
-1
cpp
Accepted
31
491,520
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; int n,ans; int vis[100005]; char ch[6]; int cal() { int len=strlen(ch); return len*100+ch[len-1]-'A'; } main() { scanf("%d",&n); for (int i=1;i<=n;++i) scanf("%s",ch), ++vis[cal()]; for (int t,i=1;i<=n;++i) { scanf("%s",ch), t=cal(); if (vis[t]) --vis[t]; else ++ans; } printf("%d\n",ans); }
codeforces
37
413
96466908
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define sort(v) sort(v.begin(),v.end()) int main() { ll a,b,c,d,e,i,j,h,k=0; vector<string>v; string s; map<string,ll>m; cin>>a; for(i=1;i<=a;i++) { cin>>s; m[s]++; } for(i=1;i<=a;i++) { cin>>s; if(m[s]>0){m[s]--;} else k++; } cout<<k<<endl; }
codeforces
37
413
39706151
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; typedef long long ll; map<string, int>M; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; M[s]++; } for (int i = 0; i < n; i++) { string s; cin >> s; M[s]--; } int ans = 0; ans = max(max(abs(M["M"]), abs(M["S"])), abs(M["L"])) + abs(M["XL"]) + abs(M["XXL"]) + abs(M["XXXL"]); cout << ans << endl; }
codeforces
37
414
39730515
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> #define ll long long int using namespace std; int main() { string a[101],b[101]; int n,ans=0;bool done[101]; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n;i++) cin>>b[i]; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(b[i].size()==a[j].size()&&!done[j]&&b[i]==a[j]) { ans++; done[j]=1; break; } } } cout<<n-ans; }
codeforces
37
414
40201465
1000A
-1
cpp
Accepted
31
24,576
#include <iostream> #include <map> using namespace std; int main() { int n; cin>> n; map<string,int> b; int countt = n; string tmp; int i = 0; for(i = 0;i<n;i++) { cin>>tmp; b[tmp]++; } for(;i<2*n;i++) { cin>>tmp; if(b[tmp]){b[tmp]--;countt--;} //else {b[tmp]++;} } cout << countt << endl; }
codeforces
37
414
67158145
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> #define FAST ios::sync_with_stdio(false); using namespace std; int main(){ FAST; int n; cin >>n; string a[n]; string b[n]; map<string,int> mp; for(int i=0;i<n;i++){ cin >>a[i]; mp[a[i]]++; } int dem=0; for(int i=0;i<n;i++) cin >>b[i]; for(int i=0;i<n;i++){ if(mp[b[i]]>0) mp[b[i]]--; else{ dem++; } } cout << dem; }
codeforces
37
414
39863268
1000A
-1
cpp
Accepted
31
307,200
#include <iostream> #include <algorithm> #include <string> #include <map> using namespace std; int n, i, j,timeln; map<string, int>dem; void nhap() { cin >> n; string c; for (i = 1; i <= n; i++) { cin >> c; dem[c]++; } for (i = 1; i <= n; i++) { cin >> c; if (dem[c]) { timeln++; dem[c]--; } } } int main() { nhap(); cout << n - timeln; return 0; }
codeforces
37
415
51347757
1000A
-1
cpp
Accepted
31
16,384
#include <iostream> #include <algorithm> #include <vector> #include <string> int main() { int n, c=0; std::string s; std::vector<std::string>m; std::cin >> n; for (int i = 0; i < n; i++) { std::cin >> s; m.push_back(s); } for (int i = 0; i < n; i++) { std::cin >> s; auto it = std::find(m.begin(), m.end(), s); if (it != m.end())m.erase(it); else c++; } std::cout << c; }
codeforces
37
415
70405862
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <map> using namespace std; const int maxn=1e4+10; int n,ans; map<string,int>num; int main() { cin>>n; for (int i=1;i<=n;i++) { string ss; cin>>ss; num[ss]++; } for (int i=1;i<=n;i++) { string ss; cin>>ss; if (num[ss]>0) num[ss]--,ans++; } printf("%d\n",n-ans); return 0; }
codeforces
37
415
100593360
1000A
-1
cpp
Accepted
46
8,192
#include<bits/stdc++.h> #define ll long long #define tc ll t; cin>>t; while(t--) using namespace std; int main() { ll n; cin>>n; ll m=n,c=0; map <string,int> mp; map <string,int> :: iterator it; while(n--) { string s; cin>>s; mp[s]++; } while(m--) { string s; cin>>s; if(mp[s]>=1) mp[s]--; else c++; } cout<<c<<endl; }
codeforces
37
415
39707422
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> using namespace std; int main(){ int n,i; cin>>n; string s; string s2; map<string,int> m; for(i=0;i<n;i++){ cin>>s; if(m.find(s)==m.end()) m[s]=1; else{ m[s]=m[s]+1; } } int t=0; for(i=0;i<n;i++){ cin>>s2; if(m.find(s2)!=m.end() && m[s2]>0){ m[s2]=m[s2]-1; } else{ t++; } } cout<<t; return 0; }
codeforces
37
416
39738118
1000A
-1
cpp
Accepted
15
12,288
#include<bits/stdc++.h> using namespace std; int main(void){ //freopen("input.txt","r",stdin); int n,ans=0; scanf("%d",&n); map<string,int> mp; for(int i=0;i<n;i++){ string S; cin >> S; mp[S]++; } for(int i=0;i<n;i++){ string S; cin >> S; if(mp[S]==0)ans++; else mp[S]--; } printf("%d",ans); }
codeforces
37
416
40151307
1000A
-1
cpp
Accepted
31
151,552
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; map<string,int> first, second; for(int i = 0; i < n; i++){ string s; cin >> s; first[s]++; } for(int i = 0; i < n; i++){ string s; cin >> s; second[s]++; } int answer = 0; for(auto s : second) answer += max(0, s.second - first[s.first]); cout << answer << endl; }
codeforces
37
416
41652420
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],b[n]; for(int i=0;i<n;i++) { cin>>a[i]; if(m.find(a[i])==m.end())m[a[i]]=1; else m[a[i]]++; } int ans=0; for(int i=0;i<n;i++) { cin>>b[i]; if(m.find(b[i])==m.end())ans++; else{ if(m[b[i]]==0){ ans++; } else{ m[b[i]]--; } } } cout<<ans; }
codeforces
37
416
39769100
1000A
-1
cpp
Accepted
31
4,096
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0);cin.tie(0); int n;cin>>n; string a[n],b[n];int f[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++)f[i]=0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(a[i]==b[j]&&f[j]==0){f[j]=1;break;} } } int sum=0; for(int i=0;i<n;i++)if(f[i]==0)sum++; cout<<sum<<endl; }
codeforces
37
417
41400555
1000A
-1
cpp
Accepted
31
20,480
#include<iostream> #include<string> #include<algorithm> #include<map> using namespace std; int main() { int n; while(cin>>n) { int sum=0; map<string,int>mm; for(int i=1;i<=n;i++) { string a; cin>>a; mm[a]++; } for(int i=1;i<=n;i++) { string b; cin>>b; if(mm[b]) mm[b]--; else sum++; } cout<<sum<<endl; } return 0; }
codeforces
37
417
42240705
1000A
-1
cpp
Accepted
31
4,096
#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <vector> #include <map> using namespace std; map<string,int> Hash; int N; int main(){ ios::sync_with_stdio(false); cin>>N; for(register int i=1;i<=N;++i){ string s;cin>>s;++Hash[s]; } int Ans=0; for(register int i=1;i<=N;++i){ string s;cin>>s; if(Hash[s]) --Hash[s]; else ++Ans; } cout<<Ans<<endl; return 0; }
codeforces
37
417
51109492
1000A
-1
cpp
Accepted
31
16,384
#include<cstdio> #include<cstring> #include<string> #include<iostream> typedef long long ll; using namespace std; int n,ans = 0; string a[110],b[110]; 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]) { b[j] = ""; ++ans; break; } printf("%d",n - ans); return 0; }
codeforces
37
417
40688897
1000A
-1
cpp
Accepted
31
4,096
#include <bits/stdc++.h> using namespace std; map <string, int> m; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n,ans=0; cin >> n; for (int i=0; i<n; i++) { string s; cin >> s; m[s]++; } for (int i=0; i<n; i++) { string s; cin >> s; m[s]--; } for (map <string, int>:: iterator j=m.begin(); j!=m.end(); j++) { if ((*j).second>0)ans+=(*j).second; } cout << ans << endl; }
codeforces
37
418
41131402
1000A
-1
cpp
Accepted
46
8,192
#include <bits/stdc++.h> using namespace std; vector <string> a; map <string,int>m; int main() { int n; cin>>n; for(int i=0; i<2*n; i++){ string x; cin>>x; if(i<n) a.push_back(x); else m[x]++; } int ans=0; for(int i=0; i<n; i++){ if(m[a[i]]==0) ans++; else m[a[i]]--; } cout<<ans; return 0; }
codeforces
37
418
39716562
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<string>v,v1; for(int i=1;i<=n;i++) { string st; cin>>st; v.push_back(st); } vector<string>::iterator it; for(int i=1;i<=n;i++) { string st; cin>>st; it=find(v.begin(),v.end(),st); if(it==v.end()) v1.push_back(st); else v.erase(it); } cout<<v1.size(); return 0; }
codeforces
37
419
40221241
1000A
-1
cpp
Accepted
30
8,192
#include<iostream> #include<algorithm> #include<string> #include<map> using namespace std; int n, ans; map<string, int>mp; int main() { cin >> n; 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]--; } for (auto it = mp.begin(); it != mp.end(); it++) ans += (*it).second; cout << ans; return 0; }
codeforces
37
419
40221241
1000A
-1
cpp
Accepted
30
8,192
#include<iostream> #include<algorithm> #include<string> #include<map> using namespace std; int n, ans; map<string, int>mp; int main() { cin >> n; 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]--; } for (auto it = mp.begin(); it != mp.end(); it++) ans += (*it).second; cout << ans; return 0; }
codeforces
37
419
40497193
1000A
-1
cpp
Accepted
30
24,576
#include<bits/stdc++.h> using namespace std; #define pb push_back #define all(x) (x).begin(),(x).end() int main() { vector<string> pre; vector<string>::iterator it; int n,i; string q; cin>>n; for(i=0;i<n;i++) { cin>>q; pre.pb(q); } for(i=0;i<n;i++) { cin>>q; for(it=pre.begin();it<pre.end();it++) { if(*it==q) { pre.erase(it); break; } } } cout<<pre.size()<<endl; return 0; }
codeforces
37
419
40936542
1000A
-1
cpp
Accepted
31
12,288
#include<bits/stdc++.h> using namespace std; string s[106],c[106]; int a[106]; int main() { int n; int cnt=0; scanf("%d",&n); for(int i=1;i<=n;i++){ cin>>c[i]; } for(int i=1;i<=n;i++){ cin>>s[i]; } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(a[j]){ continue; } if(c[i]==s[j]){ a[j]=1; cnt++; break; } } } printf("%d\n",n-cnt); return 0; }
codeforces
37
419
43495974
1000A
-1
cpp
Accepted
31
159,744
#include<bits/stdc++.h> using namespace std; int main() { int n,i,x,p=0; cin>>n; string v; vector<string>s; for(i=0;i<n;i++) { cin>>v; s.push_back(v); } multiset<string>w; for(i=0;i<n;i++) { cin>>v; w.insert(v); } for(i=0;i<n;i++) if(w.find(s[i])!=w.end()) { p++; w.erase(w.find(s[i])); } cout<<n-p; }
codeforces
37
419
39708234
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ string s[9]={"M","S","L","XL","XS","XXL","XXS","XXXL","XXXS"}; map<string,int>m;string x; int n; cin>>n; for(int i=0;i<n;i++){ cin >> x; m[x]++; } for(int i=0;i<n;i++){ cin >> x; m[x]--; } int p=0; for(int i=0;i<9;i++){ if(m[s[i]]<0) p+=abs(m[s[i]]); } cout <<p; return 0;}
codeforces
37
420
39756536
1000A
-1
cpp
Accepted
31
32,768
#include<bits/stdc++.h> using namespace std; map<string,int> m; string s1[500]; string s2[500]; int main(){ int n; cin >> n; 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]--; else s1[ans++] = s; } cout << ans << endl; // for(int i = 0 ; i < ans ; i ++){ // // } }
codeforces
37
420
41334140
1000A
-1
cpp
Accepted
31
315,392
#include<cstdio> #include<iostream> #include<cstring> using namespace std; const int maxn = 105; string s1[maxn],s2[maxn]; int main(){ int n; scanf("%d",&n); for(int i = 1;i <= n;i++){ cin >> s1[i]; } int s = 0; for(int i = 1;i <= n;i++){ cin >> s2[i]; for(int j = 1;j <= n;j++){ if(s1[j] == s2[i]){ s++; s1[j] = "w"; break; } } } printf("%d",n-s); return 0; }
codeforces
37
420
39709662
1000A
-1
cpp
Accepted
31
8,192
#include <iostream> #define MAX 100 using namespace std; main(){ int n, s; cin >> n; s = 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].compare(b[j]) == 0) && (a[i] != " ")){ a[i] = " "; b[j] = " "; --s; } } } printf("%d", s); }
codeforces
37
421
39764977
1000A
-1
cpp
Accepted
31
3,342,336
#include<stdio.h> #include<string.h> #include<math.h> int main () { char x[102][52],y[102][52]; int z,i,j,p=0,q; scanf("%d",&z); for(i=1;i<=z;i++) scanf("%s",&x[i]); for(j=1;j<=z;j++) scanf("%s",&y[j]); for(i=1;i<=z;i++){ q=0; for(j=1;j<=z;j++){ if(strcmp(x[i],y[j])==0) { q=1; strcpy(y[j],""); break; } } if(q==0) p++; } printf("%d\n",p); return 0; }
codeforces
37
421
114526255
1000A
-1
cpp
Accepted
31
32,768
#include<iostream> #include<map> const int N =1e4; using namespace std; int main(){ map<string, int> tab; string ans; int n, cnt; cin >> n; cnt = n; for(int t = 0; t < n; t++){ cin >> ans; tab[ans]++; } for(int t = 0; t < n; t++){ cin >> ans; if(tab[ans]) { tab[ans]--; cnt--; } } cout << cnt << endl; return 0; }
codeforces
37
421
118881036
1000A
-1
cpp
Accepted
46
12,288
#include <iostream> #include <string> #include <cmath> #include <map> using namespace std; int a[300]={0},b[300]={0}; string s; map <string,long long > m; int main() { int n; cin >> n; for(int i=0;i<n;i++){ cin >> s; m[s]++; } int ans=n; for(int i=0;i<n;i++){ cin >> s; if(m[s]-- > 0) ans--; } cout << ans; return 0; }
codeforces
37
421
39775451
1000A
-1
cpp
Accepted
31
151,552
#include<iostream> #include<set> #include<string> using namespace std; int main() { int n = 0; int cnt = 0; cin >> n; string s; string s1; multiset<string>mp; for (int i = 0;i < n;i++) { cin >> s; mp.insert(s); } for (int i = 0;i < n;i++) { cin >> s1; auto it = mp.find(s1); if (it != mp.end()) { mp.erase(it); } else { cnt++; } } cout << cnt << endl; }
codeforces
37
422
39787482
1000A
-1
cpp
Accepted
31
16,384
#include <string> #include <iostream> #include <map> int main() { int i, n, counter = 0;; std::string buff; std::map<std::string, int> map; std::cin >> n; for (i = 0; i < n; ++i) { std::cin >> buff; ++map[buff]; } for (i = 0; i < n; ++i) { std::cin >> buff; if (map[buff] == 0) { ++counter; } else { --map[buff]; } } std::cout << counter; return 0; }
codeforces
37
422
39705207
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const int N = 1e5+50; const ll oo = 1e18; const int mod = 1e9+7; map<string,int> mp; int main(){ int n; cin>>n; string s; for(int i=0;i<n;i++){ cin>>s; mp[s]++; } int ans=0; for(int i=0;i<n;i++){ cin>>s; if(mp[s]){ mp[s]--; }else{ ans++; } } cout << ans << endl; }
codeforces
37
423
39755915
1000A
-1
cpp
Accepted
31
20,480
#include <iostream> #include <vector> #include <string> #include <map> using namespace std; int main() { int n; cin >> n; map<string, int> cnt; for (int i = 0; i < n; i += 1) { string size; cin >> size; cnt[size] += 1; } for (int i = 0; i < n; i += 1) { string size; cin >> size; if (cnt[size] > 0) cnt[size] -= 1; } int ans = 0; for (auto &itr : cnt) ans += itr.second; cout << ans << endl; }
codeforces
37
423
71485035
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> using namespace std; int main(){ string p,k; long long a,b,c,d,e,f,g,h,i,j,l=0,m,n,o,q,r,s,t,u,v,w,x,y,z=0; map<string,long long>ab; cin>>a; for(i=1;i<=a;i++){ cin>>p; ab[p]++; } for(i=1;i<=a;i++){ cin>>p; if(ab[p]==0){ l++; } else{ ab[p]--; } } cout<<l; }
codeforces
37
423
39704792
1000A
-1
cpp
Accepted
31
8,192
#include<bits/stdc++.h> #include<thread> typedef long long ll; using namespace std; map<string, ll> st; int main(){ ll n; cin >> n; ll ans = 0; string temp; for(int i = 0; i < n; i++){ cin >> temp; st[temp]++; } for(int i = 0; i < n; i++){ cin >> temp; if(st[temp] == 0){ ans++; } else st[temp]--; } cout << ans << endl; return 0; }
codeforces
37
424
39745964
1000A
-1
cpp
Accepted
30
143,360
#include<bits/stdc++.h> using namespace std; #define ll long long #define all(x) x.begin(),x.end() int main() { int n; cin>>n; map<string,int> s1,s2; string s; for(int i=0;i<n;i++) {cin>>s; s1[s]++;} for(int i=0;i<n;i++) {cin>>s; s2[s]++;} int ans=0; for(auto p:s2) { if(!s1.count(p.first)) ans+=p.second; else if(s1[p.first]<p.second) ans+= p.second-s1[p.first] ; } cout<<ans; }
codeforces
37
424
40706038
1000A
-1
cpp
Accepted
31
16,384
#include<bits/stdc++.h> using namespace std; string a[105]; string b[105]; int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i++)cin>>a[i]; for(int i=0;i<n;i++)cin>>b[i]; int i=0,j=0; int res=0; sort(a,a+n); sort(b,b+n); while(i<n&&j<n){ if(a[i]==b[j])res++,i++,j++; if(a[i]<b[j])i++; if(a[i]>b[j])j++; } printf("%d\n",n-res); }
codeforces
37
424
45504197
1000A
-1
cpp
Accepted
31
4,812,800
#include <iostream> #include <algorithm> using namespace std; string a[100001],b[100001]; int main(){ int n,ans = 0; cin >> n; for(int i=0;i<n;i++){ cin >> a[i]; } for(int i=0;i<n;i++){ cin >> b[i]; } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(a[i] == b[j]){ b[j] = "#"; break; } } } for(int i=0;i<n;i++){ if(b[i] != "#")ans++; } cout << ans; return 0; }
codeforces
37
424
65919939
1000A
-1
cpp
Accepted
31
155,648
#include <iostream> #include <set> using namespace std; int main() { multiset<string> st; int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; st.insert(s); } int ans = 0; for (int i = 0; i < n; i++) { string s; cin >> s; if (!st.count(s)) { ans++; } else { st.erase(st.find(s)); } } cout << ans << '\n'; return 0; }
codeforces
37
424
112058365
1000A
-1
cpp
Accepted
30
8,192
#include<iostream> #include<string> using namespace std; #define N 104 int main() { int n,i,j; int key=0; string s,a[N]; cin>>n; for(i=0;i<n;i++) { cin>>s; a[i]=s; } for(i=0;i<n;i++) { int flag=0; cin>>s; for(j=0;j<n;j++) { if(s==a[j]) { a[j]="ll"; flag=1; break; } } if(flag==0) { key++; } } cout<<key<<endl; return 0; }
codeforces
37
424
112058365
1000A
-1
cpp
Accepted
30
8,192
#include<iostream> #include<string> using namespace std; #define N 104 int main() { int n,i,j; int key=0; string s,a[N]; cin>>n; for(i=0;i<n;i++) { cin>>s; a[i]=s; } for(i=0;i<n;i++) { int flag=0; cin>>s; for(j=0;j<n;j++) { if(s==a[j]) { a[j]="ll"; flag=1; break; } } if(flag==0) { key++; } } cout<<key<<endl; return 0; }
codeforces
37
424
39721005
1000A
-1
cpp
Accepted
31
20,480
#include<bits/stdc++.h> using namespace std; typedef pair<int,int> ii; int main() { int n,nb=0; cin>>n; vector<string> tab; for(int i=0;i<n;i++) { string t; cin>>t; tab.push_back(t); } for(int i=0;i<n;i++) { string t; cin>>t; for(int j=0;j<tab.size();j++) { if(tab[j]==t) {tab.erase(tab.begin()+j);break;} } } cout<<tab.size()<<endl; return(0); }
codeforces
37
425
39733612
1000A
-1
cpp
Accepted
30
12,288
#include<bits/stdc++.h> using namespace std; int main() { int n,i,j,k,c=0; cin>>n; vector <string> vs1(n),vs2(n); for(i=0;i<n;i++) { cin>>vs1[i]; } for(i=0;i<n;i++) { cin>>vs2[i]; } for(i=0;i<vs1.size();i++) {k=0; for(j=0;j<vs2.size();j++) { if(vs1[i]==vs2[j]) {k=1; vs2[j]="Z"; break; } } if(k==0)c++; } cout<<c; return 0; }
codeforces
37
425
39822092
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> using namespace std; const int NMax=100; int main(){ int n; cin>>n; string a[NMax], b[NMax]; for (int i=0; i<n; i++) cin>>a[i]; for (int i=0; i<n; i++) cin>>b[i]; int ans=0; string s[9]={"M", "L", "S", "XS", "XL","XXS", "XXL", "XXXS", "XXXL"}; for (int i=0; i<9; i++){ ans+=abs(count(a, a+n, s[i])-count(b, b+n, s[i])); } cout<<ans/2<<endl; return 0; }
codeforces
37
425
39714416
1000A
-1
cpp
Accepted
30
12,288
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { long long i,j,k,n; string x1[103],x2[103]; cin>>n; for (i=0;i<n;i++) { cin>>x1[i]; } for (i=0;i<n;i++) { cin>>x2[i]; } long long s; s=n; for (i=0;i<n;i++) { for (j=0;j<n;j++) { if (x1[i]==x2[j]) { s--; x2[j]="0"; break; } } } cout<<s; return 0; }
codeforces
37
426
40400469
1000A
-1
cpp
Accepted
31
20,480
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<map> using namespace std; int main() { int n; while (cin>>n) { map<string, int> all; string x; for (int i(0); i < n; i++) { cin >> x; all[x]++; } for (int i(0); i < n; i++) { cin >> x; all[x]--; } int ans(0); for (auto i : all) { if (i.second > 0)ans += i.second; } cout << ans << endl; } return 0; }
codeforces
37
426
40885451
1000A
-1
cpp
Accepted
31
20,480
//����Ŀ���Ի�������� #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> using namespace std; const int maxn=1; #include<map> map<string,int>m; int n;string s; int main(){ cin>>n; 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]>0) m[s]--; else sum++; } cout<<sum<<endl; return 0; }
codeforces
37
426
106901706
1000A
-1
cpp
Accepted
31
151,552
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<string>s(n), p(n); for(int i = 0; i < n; i++) { cin >> s[i]; } for(int i = 0; i < n; i++) { cin >> p[i]; } map<string, int>a,b; for(int i = 0; i < n; i++) ++a[s[i]]; for(int i = 0 ; i < n; i++) ++b[p[i]]; int cnt = n; for(auto i: a) cnt -= min(i.second, b[i.first]); cout<<cnt; return 0; }
codeforces
37
426
39704316
1000A
-1
cpp
Accepted
31
16,384
#include<iostream> #include<map> using namespace std; string a[101],b[101]; map<string,int> Map; int main () { int n,i,res=0,j; cin>>n; for(i=0;i<n;i++) { cin>>a[i]; Map[a[i]]++; } for(j=0;j<n;j++) { cin>>b[i]; if(!Map[b[i]]) res++; else Map[b[i]]--; } cout<<res<<endl; return 0; }
codeforces
37
427
39732395
1000A
-1
cpp
Accepted
30
16,384
#include<bits/stdc++.h> using namespace std; map<string,int> mp; int cnt[11]; int main() { int n;cin>>n; mp["M"]=5;mp["XL"]=4;mp["XXL"]=3;mp["XXXL"]=2;mp["XS"]=6;mp["XXS"]=7;mp["XXXS"]=8;mp["S"]=9;mp["L"]=1; for(int i=1;i<=n;i++) { string s;cin>>s; cnt[mp[s]]++; } int res=0; for(int i=1;i<=n;i++) { string s;cin>>s; if(cnt[mp[s]]==0) res++; else cnt[mp[s]]--; } cout<<res; }//fcyakking
codeforces
37
427
39744990
1000A
-1
cpp
Accepted
31
8,192
#include <bits/stdc++.h> #define lld long long int #define rep(i,m,n) for(lld i=m;i<n;i++) using namespace std; int main() { map <string,lld> m; lld n; cin>>n; string s; rep(i,0,n) { cin>>s; m[s]++; } lld count=0; rep(i,0,n) { cin>>s; if(m[s]>0) m[s]--; else count++; } cout<<count<<endl; }
codeforces
37
427
40414351
1000A
-1
cpp
Accepted
31
20,480
#include <iostream> #include <string> #include <vector> using namespace std; vector<string> pre; int main() { int n; string str; cin >> n; int result = n; for (int i = 0; i < n; ++i) cin >> str, pre.push_back(str); for (int i = 0; i < n; ++i) { cin >> str; for (int j = 0; j < pre.size(); ++j) if (pre[j] == str) { pre.erase(pre.begin() + j); result--; break; } } cout << result << endl; }
codeforces
37
427
42311570
1000A
-1
cpp
Accepted
31
311,296
#include<bits/stdc++.h> #define ll long long #define f first #define s second #define pb push_back using namespace std; ll n,ans; pair<ll,string> s1[1001],s2[1001]; string x,y; map<string,ll>mp; int main(){ cin>>n; for(int i=1; i<=n; i++){ cin>>y; mp[y]++; s1[i].f = s1[i].s.size(); } for(int i=1; i<=n; i++){ cin>>x; if(mp[x])mp[x]--; else ans++; } cout<<ans; return 0; }
codeforces
37
427
39704339
1000A
-1
cpp
Accepted
15
8,192
#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; string s; for(int i=0;i<n;i++){ cin>>s; M[s]++; } for(int i=0;i<n;i++){ cin>>s; M[s]--; } map<string,int> :: iterator it; int ans = 0; for(it=M.begin();it!=M.end();it++){ ans += abs((*it).second); } cout<<ans/2<<'\n'; return 0; }
codeforces
37
428
41157195
1000A
-1
cpp
Accepted
31
8,192
#include<iostream> #include<map> #include<cmath> #include<string> using namespace std; int main() { int n, count=0; cin >> n; map<string, int> m; string str; for(int i=0;i<n;++i) { cin >> str; m[str]++; } for(int i=0;i<n;++i) { cin >> str; m[str]--; } for(auto elem:m) count+=abs(elem.second); cout << count/2; }
codeforces
37
428