#include <iostream>
#include <vector>
#include <map>
using namespace std;
#define maxn 100005
int n;
map<string,int> f;
int main() {
cin >> n;
for (int i = 0; i < 2*n-1; i++) {
string s; cin >> s;
if (!f.count(s)) f[s] = 1;
else f[s]++;
}
for (auto z : f) {
if (z.second%2 == 1) cout << z.first << endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
2 ms |
308 KB |
Output is correct |
4 |
Correct |
3 ms |
360 KB |
Output is correct |
5 |
Correct |
2 ms |
332 KB |
Output is correct |
6 |
Correct |
117 ms |
5268 KB |
Output is correct |
7 |
Correct |
200 ms |
7796 KB |
Output is correct |
8 |
Correct |
254 ms |
9440 KB |
Output is correct |
9 |
Correct |
281 ms |
10272 KB |
Output is correct |
10 |
Correct |
283 ms |
10368 KB |
Output is correct |