DFS1 [백준][DFS] 바이러스 https://www.acmicpc.net/problem/2606 package bkjoon.dfs;import java.util.*;class Node { int id; // 컴퓨터 번호 List children; // 연결된 컴퓨터들 Node(int id) { this.id = id; this.children = new ArrayList(); }}public class bk2606 { /** * DFS - 바이러스 * 실버3 */ static boolean[] visited; // 방문여부 체크 static int infectedCount = 0; // 감염된 컴퓨터 숫자 public static void ma.. 2025. 10. 8. 이전 1 다음