|
|
back to boardHere's Solution //Solution By Omyrzak Meirambek #include <iostream> #include <fstream> #include <cstdio> #include <math.h> #include <queue> #include <stack> #include <set> #include <string> #include <utility> #include <cstdlib> #include <algorithm> #include <ctime> #include <vector> #include <map> using namespace std; #define fname "" #define ull unsigned long long #define ll long long #define INF 1000*1000*1000 const int N = 20000; map <int, int> q; int n, x, res = 0, m; int main () { #ifndef ONLINE_JUDGE freopen ("in","r",stdin); freopen ("out","w",stdout); #endif cin >> n; for (int i = 1; i <= n; i ++ ) { cin >> x; q[x] = 1; } cin >> m; for (int i = 1; i <= m; i ++ ) { cin >> x; res += q[x]; }
cout << res; return 0; } |
|
|