-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1104.cpp
More file actions
45 lines (34 loc) · 839 Bytes
/
1104.cpp
File metadata and controls
45 lines (34 loc) · 839 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <set>
using namespace std;
int main() {
while (true) {
int a, b, number, auxB = 0, auxA = 0;
cin >> a >> b;
if (a == 0 && b == 0) {
break;
}
set<int> alice;
set<int> beatriz;
for (int i = 0; i < a; i++) {
cin >> number;
alice.insert(number);
}
for (int i = 0; i < b; i++) {
cin >> number;
beatriz.insert(number);
}
for (const int& num : beatriz) {
if (alice.find(num) == alice.end()) {
auxB++;
}
}
for (const int& num : alice) {
if (beatriz.find(num) == beatriz.end()) {
auxA++;
}
}
cout << min(auxA, auxB) << endl;
}
return 0;
}