alphacademy-cpp/quito/13.1.cpp

37 lines
691 B
C++
Raw Permalink Normal View History

2023-03-02 13:58:39 +00:00
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n;
set<string> store1;
set<string> store2;
set<string> out;
for (int i = 0; i < n; i++) {
string temp;
cin >> temp;
store1.insert(temp);
}
cin >> m;
for (int i = 0; i < m; i++) {
string temp;
cin >> temp;
store2.insert(temp);
}
for (string x : store1) {
if (!store2.count(x)) {
out.insert(x);
}
}
for (string x : store2) {
if (!store1.count(x)) {
out.insert(x);
}
}
cout<<out.size()<<endl;
for (string x : out) {
cout<<x<<endl;
}
}