Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define pb push_back
- #define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
- #define F first
- #define S second
- typedef long long ll;
- typedef vector< int > vi;
- typedef vector< ll > V;
- typedef map<int, int > mp;
- #define debug cout << -1 << endl;
- #define REP(i, a, b) for(int i=a; i<b; i++)
- #define pop pop_back
- const ll MOD = 1000000007;
- const int maxN = 2001;
- int dx[] = {-1, 0, 1, -1, 1, -1, 0, 1};
- int dy[] = {-1, -1, -1, 0, 0, 1, 1, 1};
- void solve()
- {
- int n, nn;
- cin >> n;
- mp m;
- while(n--) {
- int x;
- cin >> x;
- m[x]++;
- }
- cin >> nn;
- int cnt = 0;
- while(nn--) {
- int x;
- cin >> x;
- if(m[x]) cnt++;
- }
- cout << cnt << endl;
- return;
- }
- int main()
- {
- FastIO;
- //freopen("billboard.in","r",stdin);
- //freopen("billboard.out","w",stdout);
- int t;
- t = 1;
- //cin >> t;
- while(t--){
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement