#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
map<string, int> freq;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
freq[s]++;
}
map<string, int> freq2;
for (int i = 0; i < n-1; i++) {
string s;
cin >> s;
freq2[s]++;
}
for (auto x : freq) {
if (x.second > freq2[x.first]) {
cout << x.first << '\n';
break;
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
604 KB |
Output is correct |
5 |
Correct |
2 ms |
600 KB |
Output is correct |
6 |
Correct |
60 ms |
9428 KB |
Output is correct |
7 |
Correct |
102 ms |
13648 KB |
Output is correct |
8 |
Correct |
138 ms |
16512 KB |
Output is correct |
9 |
Correct |
147 ms |
18256 KB |
Output is correct |
10 |
Correct |
139 ms |
18260 KB |
Output is correct |