Created
December 16, 2016 01:55
-
-
Save uenoku/6a56bafb6ab8d46492ae7c7955536200 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <complex> | |
#include <iostream> | |
#include <map> | |
#include <queue> | |
#include <set> | |
#include <string> | |
#include <vector> | |
#define rep(i, n) for (int i = 0; i < (n); i++) | |
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--) | |
using namespace std; | |
typedef long long int lli; | |
typedef pair<lli, lli> P; | |
lli MOD = 1000000007; | |
int main() | |
{ | |
int n; | |
while (cin >> n) { | |
set<int> s, t; | |
int a; | |
rep(i, n) | |
{ | |
cin >> a; | |
s.insert(a); | |
} | |
cin >> n; | |
rep(i, n) | |
{ | |
cin >> a; | |
t.insert(a); | |
} | |
int ans = 0; | |
for (auto l : s) { | |
if (t.find(l) != t.end()) | |
ans++; | |
} | |
cout << ans << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment