#include <iostream>
#include <map>
#include <string>
using namespace std;
int n;
string str;
map<string, int> mp;
int main(){
cin >> n;
for(int i = 0; i < n; i++){
cin >> str;
mp[str]++;
}
for(int i = 0; i < n - 1; i++){
cin >> str;
mp[str]--;
if(mp[str] == 0) mp.erase(str);
}
cout << mp.begin()->first;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1724 KB |
Output is correct |
2 |
Correct |
0 ms |
1724 KB |
Output is correct |
3 |
Correct |
0 ms |
1724 KB |
Output is correct |
4 |
Correct |
3 ms |
1724 KB |
Output is correct |
5 |
Correct |
0 ms |
1724 KB |
Output is correct |
6 |
Correct |
215 ms |
7268 KB |
Output is correct |
7 |
Correct |
359 ms |
9908 KB |
Output is correct |
8 |
Correct |
436 ms |
11756 KB |
Output is correct |
9 |
Correct |
463 ms |
12812 KB |
Output is correct |
10 |
Correct |
502 ms |
12812 KB |
Output is correct |