728x90

분류 전체보기 297

69 삐약 : 백준 13913| 숨바꼭질4 [바킹독 문제 풀이|BFS|JAVA]

https://www.acmicpc.net/problem/13913  우엑 꽝 기각...중략... q.offer(new Location(N, new StringBuilder().append(N)));...중략... while(!q.isEmpty()){ Location l = q.poll();...중략... ways=l.way.toString(); } } if(l.x+1 초반에는 위치 값과 진행 순서를 문자열로 저장하는 클래스를 선언하여 문제를 풀이하려 했다.그러나 이전에도 겪었듯이 문자열 클래스를 사용하는 것은 메모리상에도 접근하는 시간 상에도 큰 부담을 줄 수 있다는 것을 알고 있기에변동성..

68 삐약 : 백준 2573| 빙산 [바킹독 문제 풀이|BFS|JAVA]

https://www.acmicpc.net/problem/2573 package BKD_0x9_BFS;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 BOJ_2573 { static int[][] glacier; static int[][] visited; static int N; static int M; static int[] dx = {1,-1,0,0}; static int[] dy = {..

67 삐약 : 백준 5427| 불 [바킹독 문제 풀이|BFS|JAVA]

https://www.acmicpc.net/problem/5427 package BKD_0x9_BFS;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 BOJ_5427 { static char[][] building; static Queue person; static Queue fire; static int[] dx={1,-1,0,0}; static int[] dy={0,0,1,-1}; pub..

64 삐약 : 백준 6593| 상범 빌딩 [바킹독 문제 풀이|BFS|JAVA]

https://www.acmicpc.net/problem/6593 package BKD_0x9_BFS;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 BOJ_6593 { static int[] dz ={0,0,0,0,1,-1}; static int[] dy ={0,0,1,-1,0,0}; static int[] dx ={1,-1,0,0,0,0}; static int L; static int R; ..

63 삐약 : 백준 10026| 적록색약 [바킹독 문제 풀이|BFS|JAVA]

https://www.acmicpc.net/problem/10026 package BKD_0x9_BFS;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.LinkedList;import java.util.Queue;public class BOJ_10026 { static char[][] RGB_colors; static char[][] RG_B_colors; static int[] dx ={0,1,0,-1}; static int[] dy ={1,0,-1,0}; static int N; public static void main(Str..

62 삐약 : 백준 7569| 토마토 [바킹독 문제 풀이|BFS|JAVA]

https://www.acmicpc.net/problem/7569 package BKD_0x9_BFS;import java.beans.Introspector;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 BOJ_7569 { static int[] dx ={1,-1,0,0,0,0}; static int[] dy ={0,0,1,-1,0,0}; static int[] dz ={0,0,0,0,1,-1}; s..

61 삐약 : 백준 7576| 토마토 [바킹독 문제 풀이|BFS|JAVA]

https://www.acmicpc.net/problem/7576  package BKD_0x9_BFS;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 BOJ_7576 { static int[] dx ={0,1,0,-1}; static int[] dy ={1,0,-1,0}; static int M; static int N; static int[][] box; static Queue q = n..

60 삐약 : 백준 2468| 안전 영역 [바킹독 문제 풀이|BFS|JAVA]

https://www.acmicpc.net/problem/2468  package BKD_0x9_BFS;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.*;public class BOJ_2468 { static int[][] input; static int[][] visited; static int N; static int[] dx ={0,1,0,-1}; static int[] dy ={1,0,-1,0}; public static void main(String[] args) throws IOException { Buff..

728x90