4963: 섬의 개수 (그래프)
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { static int W, H; static int[] dx = { -1, 1, 0, 0, -1, -1, 1, 1 }; static int[] dy = { 0, 0, -1, 1, -1, 1, 1, -1 }; static int[][] arr; static boolean[][] visited; public static void main(String[] args) throws IOException { BufferedReader br = new Buff..