Created
February 9, 2015 13:04
-
-
Save theoremoon/da4d27e55fe78e46ee76 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
* AOJ 10031 | |
* AC | |
*/ | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main() { | |
int n, m, res = 0; | |
int p[101000]; | |
cin >> n; | |
for (int i = 0; i < n; ++i) | |
cin >> p[i]; | |
sort(p, p+n); | |
cin >> m; | |
for (int i = 0; i < m; ++i) { | |
int a = 0; cin >> a; | |
res += binary_search(p, p+n, a); | |
} | |
cout << res << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment