백준 파이썬 1717번 집합의 표현Gold 5 https://www.acmicpc.net/problem/1717 집합에 대한 문제다. 유니온 파인드를 활용해 풀어주면 된다.더보기5 50 1 20 2 30 4 50 1 51 1 4막히면 위의 예시의 결과가 YES 가 나오는지 확인해보면 된다.import sysinput = sys.stdin.readlinesys.setrecursionlimit(10**9)def find_parent(x): if r[x] != x: r[x] = find_parent(r[x]) return r[x]def dfs(x, y): x = find_parent(x) y = find_parent(y) if x