[백준] 알고리즘 11724번 - 연결 요소의 개수 문제 #include using namespace std; vector v[1001]; bool check[1001]; void dfs(int x) { check[x] = true; int size = v[x].size(); for (int i = 0; i > n >> m ; for (int i = 0; i > x >> y; v[x].push_back(y); v[y].push_b.. Algorithm 2021. 1. 19. 16:18
[백준] 알고리즘 1260번 - DFS와 BFS 문제 #include using namespace std; vector v[1001]; bool check[1001]; queue qu; void dfs(int x) { check[x] = true; cout m >> start; for (int i = 0; i > x >> y; v[x].push_back(y); v[y].push_back(x); } for (int i = 1; i Algorithm 2021. 1. 19. 15:13