목록2667 (1)
(수근수근)
[백준] 2667 단지번호붙이기
문제 출처 https://www.acmicpc.net/problem/2667 DFS를 이용해서 풀었다 public class back2667 { static int[] rowD = {-1,1,0,0};//상하좌우 static int[] colD = {0,0,-1,1};//상하좌우 static int num; static boolean[][] arrCheck; static List list = new ArrayList(); static int[][] arr; static int count; public static void main(String[] args) { Scanner sc = new Scanner(System.in); num = sc.nextInt(); sc.nextLine(); arr = new..
Algorithm
2020. 4. 20. 17:15