-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy path1104.cpp
More file actions
30 lines (30 loc) · 811 Bytes
/
Copy path1104.cpp
File metadata and controls
30 lines (30 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Ivan Carvalho
// Solution to https://www.beecrowd.com.br/judge/problems/view/1104
#include <algorithm>
#include <cstdio>
#include <set>
using namespace std;
int main() {
int a, b;
while (scanf("%d %d", &a, &b) && (a || b)) {
int c = 0, d = 0;
set<int> A, B;
for (int i = 0; i < a; i++) {
int davez;
scanf("%d", &davez);
A.insert(davez);
}
for (int i = 0; i < b; i++) {
int davez;
scanf("%d", &davez);
B.insert(davez);
}
set<int>::iterator it;
for (it = A.begin(); it != A.end(); it++)
if (!B.count(*it)) c++;
for (it = B.begin(); it != B.end(); it++)
if (!A.count(*it)) d++;
printf("%d\n", min(c, d));
}
return 0;
}