자바생
article thumbnail
자바(백준) 2644 촌수계산
BOJ(Java) 2020. 12. 29. 20:34

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 import java.io.*; import java.util.*; public class Main { static int start, end; static int ad[][]; static boolean visit[]; static int count[]; static int nV; public static void main(String[] args) throws IOExceptio..

자바(백준) 1260 DFS와 BFS
BOJ(Java) 2020. 11. 12. 00:14

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 import java.io.*; import java.util.*; public class Main { static int N,M,V; static ArrayListad[]; static boolean[] visit_dfs; static StringBuilder sb_dfs = new StringBuilder(); static StringBuilder..

자바(백준) 1012 유기농 배추
BOJ(Java) 2020. 11. 11. 23:23

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 import java.io.*; import java.util.*; public class Main { static int M,N,K; // M : 가로길이 N : 세로길이 K : 배추 갯수 static boolean[][] visit; static int ad[][]; static Queue Q; public static void main(String [..

article thumbnail
자바(백준) 2606 바이러스
BOJ(Java) 2020. 11. 11. 22:33

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 import java.io.*; import java.util.*; public class Main { static boolean[] visit; static ArrayList [] ad; static int nV, nE; static Queue Q; public static void main(String []args) throws IOException{ BufferedReader br = new BufferedR..

자바(백준) 2468 안전 영역
BOJ(Java) 2020. 11. 7. 21:37

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 import java.util.*; import java.io.*; public class Main { static int N; static int ad[][]; static boolean visit[][]; static int max_height = 0; //높이 최대 static int min_height = 100; //높이 최저 public static void main(String[] ar..

자바(백준) 2667 단지번호 붙이기
BOJ(Java) 2020. 11. 5. 16:53

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 import java.io.*; import java.util.*; public class Main { static int[][] ad; static boolean[][] visit; static int N; static int component = 0; static int[] size_arr; static int size; public static void main(Strin..

article thumbnail
자바(백준) 2583 영역 구하기
BOJ(Java) 2020. 11. 4. 14:41

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 import java.io.*; import java.util.*; public class Main { static int M,N,K; static boolean[][] visit; static int[][] ad; static int[] dx = {0,0,1,-1}; static int[] dy = {1,-1,0,0}; static int..

자바(백준) 1012 유기농 배추
BOJ(Java) 2020. 11. 3. 18:17

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 import java.net.Inet4Address; import java.util.*; import java.io.*; public class Main { static boolean[][] visit; static int[][] ad; static int N,M,K; public static void main(String[] args) throws IOException{ BufferedReader br = new Bu..

자바(백준) 1926 그림
BOJ(Java) 2020. 11. 3. 14:31

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 import java.net.Inet4Address; import java.util.*; import java.io.*; public class Main { static int n,m; static int [][] ad; static boolean [][] visit; static int draw_size; //그림의 크기 public static void main(String..

자바(백준) 1743 음식물 피하기
BOJ(Java) 2020. 11. 3. 13:40

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 import java.util.*; import java.io.*; public class Main { static boolean[][] visit; static int[][] ad; static int N; //행의 개수 static int M; //열의 개수 static int K; //간선의 개수 static int dx[] = {0,0,1,-1}; static int dy[] = {-1,1,0,0..

article thumbnail
자바(백준) 1068 트리
BOJ(Java) 2020. 11. 3. 12:54

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 import java.util.*; import java.io.*; public class Main { static boolean[]visit; static ArrayList []ad; static int nV; //노드의 개수 static int leaf_Node; public static void main(Strin..

자바(백준) 4963 섬의 개수
BOJ(Java) 2020. 11. 2. 20:57

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 import java.util.Scanner; public class Main { static int w,h; static boolean[][] visit; static int[][] ad; static int[] dx = {1,1,1,0,0,-1,-1,-1}; static int[] dy = {0,-1,1,1,-1,1,0,-1}; static int island; public static void main(String []arg..

728x90

검색 태그