🔗문제 풀러가기
단계별로 풀어보기 단계 14의 5번째 문제이다.
Set 컨네이너를 이용해 문제를 해결하였다.
#include <iostream>
#include <set>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
set<int> _set;
for (int i = 0; i < a + b; i++)
{
int input;
cin >> input;
if (_set.find(input) != _set.end())
{
_set.erase(input);
}
else
{
_set.insert(input);
}
}
cout << _set.size();
}