#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main() {
int n, q, key;
int sum = 0;
int A[100000 + 10];
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", &A[i]);
scanf("%d", &q);
for (int i = 0; i < q; i++) {
scanf("%d", &key);
if (binary_search(A, A + n, key))
sum++;
}
printf("%d\n", sum);
}
ALDS1_4_B 2018-2-21
最新推荐文章于 2020-02-25 21:39:01 发布