#include<bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
map<string, int>cnt, finished;
for (int i = 0; i < n; i++) {
string s; cin >> s;
cnt[s]++;
}
for (int i = 1; i < n; i++) {
string s; cin >> s;
finished[s]++;
}
string ans;
for (auto i : cnt) {
int x = i.second;
int y = finished[i.first];
if (x != y) {
ans = i.first;
}
}
cout << ans << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
444 KB |
Output is correct |
4 |
Correct |
2 ms |
604 KB |
Output is correct |
5 |
Correct |
2 ms |
604 KB |
Output is correct |
6 |
Correct |
89 ms |
9236 KB |
Output is correct |
7 |
Correct |
131 ms |
13552 KB |
Output is correct |
8 |
Correct |
148 ms |
16724 KB |
Output is correct |
9 |
Correct |
207 ms |
18148 KB |
Output is correct |
10 |
Correct |
186 ms |
18208 KB |
Output is correct |