Skip to content

Instantly share code, notes, and snippets.

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) {
while(n--) {
cin >> 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.