#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
map<string, int> cnt;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
cnt[s]++;
}
for (int i = 0; i < n - 1; i++) {
string s;
cin >> s;
cnt[s]--;
}
for (auto &p : cnt) {
if (p.second & 1) {
cout << p.first << '\n';
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
324 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
404 KB |
Output is correct |
6 |
Correct |
54 ms |
5316 KB |
Output is correct |
7 |
Correct |
83 ms |
7764 KB |
Output is correct |
8 |
Correct |
111 ms |
9404 KB |
Output is correct |
9 |
Correct |
120 ms |
10384 KB |
Output is correct |
10 |
Correct |
132 ms |
10272 KB |
Output is correct |