코딩테스트/백준
2024. 9. 9.
[백준] 11724번: 연결 요소의 개수
🔗 문제 링크https://www.acmicpc.net/problem/11724👩💻 코드#include #include using namespace std;void DFS(int v, vector &visited, vector> &graph){ if (visited[v]){ return; } visited[v] = true; for (int i : graph[v]){ if (visited[i] == false){ DFS(i, visited, graph); } }}int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL..