# include <bits/stdc++.h>
using namespace std;
map<string, int> S;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int N;
cin>>N;
for(int i=0;i<N;i++) {
string c;
cin>>c;
S[c]++;
}
for(int i=1;i<N;i++) {
string c;
cin>>c;
S[c]--;
}
for(auto p : S) {
if(p.second == 1) cout<<p.first<<"\n";
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
332 KB |
Output is correct |
5 |
Correct |
2 ms |
328 KB |
Output is correct |
6 |
Correct |
61 ms |
5356 KB |
Output is correct |
7 |
Correct |
92 ms |
7756 KB |
Output is correct |
8 |
Correct |
130 ms |
9420 KB |
Output is correct |
9 |
Correct |
144 ms |
10404 KB |
Output is correct |
10 |
Correct |
120 ms |
10332 KB |
Output is correct |