Skip to content

Instantly share code, notes, and snippets.

@fredbr
Created May 21, 2018 20:42
Show Gist options
  • Save fredbr/a5741fa1510fa5787412f5691a57d3f3 to your computer and use it in GitHub Desktop.
Save fredbr/a5741fa1510fa5787412f5691a57d3f3 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int compra[maxn];
int car[maxn];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, c, m;
cin >> n >> c >> m;
for (int i = 0; i < c; i++) {
int a;
cin >> a;
car[a] = 1;
}
for (int i = 0; i < m; i++) {
int a;
cin >> a;
compra[a] = 1;
}
int ans = c;
for (int i = 1; i <= n; i++) {
if (car[i] and compra[i]) ans--;
}
cout << ans << "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment