자바생
자바(백준) 1389 케빈 베이컨의 6단계 법칙
BOJ(Java) 2020. 12. 30. 16: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 70 71 import java.io.*; import java.util.*; public class Main { static int nV, nE; static int ad[][]; static boolean visit[]; static int count[][]; public static void main(String[] args) throws IOExce..

자바(백준) 11724 연결 요소의 개수
BOJ(Java) 2020. 12. 30. 14:36

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 import java.io.*; import java.util.*; public class Main { static int nV, nE; static int ad[][]; static boolean visit[]; static int component = 0; public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new Inp..

자바(백준) 7562 나이트의 이동
BOJ(Java) 2020. 12. 30. 13:49

ㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴ 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 import java.io.*; import java.util.*; public class Main { static int count[][]; static boolean visit[][]; static int size; public static void main(String[] args) throws IOExcept..

자바(백준) 4963 섬의 개수
BOJ(Java) 2020. 12. 30. 12:05

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 import java.io.*; import java.util.*; public class Main { static int w,h; static int ad[][]; static boolean visit[][]; public static void main(String[] args) throws IOException{ BufferedReader br = new B..

자바(백준) 3184 양
BOJ(Java) 2020. 12. 30. 11:35

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 77 78 79 80 81 82 83 import java.io.*; import java.util.*; public class Main { static int row,col; static char ad[][]; static boolean visit[][]; static int cntO = 0; static int cn..

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..

BFS
Algorithm 개념 2020. 11. 11. 22:09

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 77 import java.io.*; import java.util.*; public class Main { static ArrayList ad[]; static boolean[] visit; static int nV,nE; //노드, 간선 갯수 static Queue Q; static LinkedList link; p..

자바(백준) 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..

728x90

검색 태그