Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <iostream>
- #define N 4005
- using namespace std;
- int a[3][N], n[3], res = 0;
- int main() {
- for (int i = 0; i < 3; i++) {
- cin >> n[i];
- for (int j = 0; j < n[i]; j++)
- cin >> a[i][j];
- }
- for (int i = 0; i < n[0]; i++) {
- int cnt = 0;
- for (int j = 1; j < 3; j++)
- for (int k = 0; k < n[j]; k++) {
- if (a[j][k] == a[0][i])
- cnt++;
- }
- if (cnt == 2) res++;
- }
- cout << res;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement