Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
My solution for UVA 11849
#include <iostream>
#include <set>
using namespace std;
#define ll long long
ll n, m, x, ans;
set<ll> cds;
int main() {
while(cin >> n >> m, n||m) {
cds.clear();
while(n--) {
cin >> x;
cds.insert(x);
}
ans = 0;
while(m--) {
cin >> x;
if(cds.find(x) != cds.end()) ans++;
}
cout << ans << '\n';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.