dh-winternagi 님의 블로그
(1269) 대칭 차집합 본문
https://www.acmicpc.net/problem/1269
단계별로 풀어보기
14단계(집합과 맵) 7번째

#include <iostream>
#include <set>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n, m, ans;
set<int> s;
cin >> n >> m;
ans= n+m;
while(n--){
int t;
cin >> t;
s.insert(t);
}
while(m--){
int t;
cin >> t;
ans-= 2*s.count(t);
}
cout << ans;
return 0;
}'백준 (C++) > Solve' 카테고리의 다른 글
| (1934) 최소공배수 (0) | 2026.04.14 |
|---|---|
| (11478) 서로 다른 부분 문자열의 개수 (0) | 2026.04.14 |
| (1764) 듣보잡 (0) | 2026.04.14 |
| (10816) 숫자 카드 2 (0) | 2026.04.14 |
| (1620) 나는야 포켓몬 마스터 이다솜 (0) | 2026.04.14 |
