#include <iostream>
#include <map>
using namespace std;
int main(){
int n;
string str;
cin>>n;
map<string,int> m;
for(int i=0;i<n;i++){
cin>>str;
if(m.find(str)==m.end()){
m.insert(make_pair(str,1));
}
else m[str]++;
}
for(int i=0;i<n-1;i++){
cin>>str;
m[str]--;
if(m[str]==0)m.erase(str);
}
for(auto it=m.begin();it!=m.end();it++){
cout<<it->first;
break;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Correct |
3 ms |
364 KB |
Output is correct |
5 |
Correct |
3 ms |
364 KB |
Output is correct |
6 |
Correct |
165 ms |
5484 KB |
Output is correct |
7 |
Correct |
261 ms |
7788 KB |
Output is correct |
8 |
Correct |
335 ms |
9564 KB |
Output is correct |
9 |
Correct |
362 ms |
10348 KB |
Output is correct |
10 |
Correct |
374 ms |
10496 KB |
Output is correct |