백준알고리즘
-
[Algorithm] 백준 알고리즘 14502 (연구소)Algorithm 2020. 3. 29. 12:14
java 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class Lab { static int N, M; static int map[][]; static int virusMap[][]; static boolean visited[]; static ArrayList qWall = new ArrayList(); static int result; public static ..
-
[Algorithm] 백준 알고리즘 11724 (연결 요소의 개수)Algorithm 2020. 3. 28. 16:23
java 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class LinkCount { static int N, M, count; static int map[][]; static boolean visited[]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamR..
-
[Algorithm] 백준 알고리즘 11403 (경로 찾기)Algorithm 2020. 3. 28. 14:55
java 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class FindRute { static int N; static int map[][]; static boolean visited[][]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(Sys..
-
[Algorithm] 백준 알고리즘 1012 (유기농 배추)Algorithm 2020. 3. 28. 13:15
java 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class Main { static int T, M, N, K; static int map[][]; static boolean visited[][]; static int count; static Queue q = new LinkedList(); public static void main(String[] args) throws IOException { Buffer..
-
[Algorithm] 백준 알고리즘 1697 (숨바꼭질)Algorithm 2020. 3. 28. 12:29
java 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class HideSeek { static int N,K; static boolean visited[]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringToke..
-
[Algorithm] 백준 알고리즘 2667 (단지 번호 붙이기)Algorithm 2020. 3. 22. 00:05
java코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class SetNumber { static int N; static int map[][]; static boolean visited[][]; static int house[]; static int num=1; public static void main(String[] args) throws IOException { B..
-
[Algorithm] 백준 알고리즘 2178 (미로찾기)카테고리 없음 2020. 3. 22. 00:01
java코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class FindMaze{ static int N, M; static int maze[][]; static boolean visited[][]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(S..
-
[Algorithm] 백준 알고리즘 1260 (DFS와 BFS)Algorithm 2020. 3. 15. 22:52
java 코드 import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { static int n; static int m; static int v; static int map[][]; static boolean visit[]; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); m = sc.nextInt(); v = sc.nextInt(); map = new int[n+1][n+1]; visit = new boolean[n+1]; for(int i=0; i