https://www.acmicpc.net/problem/24479import syssys.setrecursionlimit(10**6)input = sys.stdin.readlinen, m, r = map(int, input().split())graph = [[] for _ in range(n+1)]visited = [0] * (n+1)seq = 1 # 방문순서def dfs(r): global seq visited[r] = seq graph[r].sort() for i in graph[r]: if visited[i] == 0: seq += 1 dfs(i)for _ in range(m): u, v = map(int, input(..