
[백준] 1062번: 연결 요수의 개수 (JavaScript)
·
PS
문제https://www.acmicpc.net/problem/11724개념그래프 탐색DFS, BFS구현 코드(JavaScript)const fs = require('fs');let input = fs.readFileSync('/dev/stdin').toString().trim().split('\n');const [n, m] = input[0].split(' ').map(Number);const graph = Array(n + 1) .fill(0) .map(() => Array(n + 1).fill(0));for (let i = 1; i { const queue = [start]; visited[start] = true; while (queue.length) { const node = qu..