๐ป Coding Problems Solving/DFS | BFS | Backtracking
[BOJ 17086] ์๊ธฐ์์ด2
1. ๋ฌธ์ : https://www.acmicpc.net/problem/17086 2. ํ์ด ์์ด๋ฅผ ์ค์ฌ์ผ๋ก bfsํ๋ ์๊ฐ์ด ์ค์ํ ๋ฌธ์ ๊ฑฐ๋ฆฌ์ ๊ฒฝ์ฐ visited๋ณด๋จ dis๋งต์ ๋ง๋ค์ด์ ๊ฑฐ๋ฆฌ๋ฅผ ๋ํ๋ ์์ผ๋ก ๊ตฌํํ์ 3. ์ฝ๋ package baekjoon; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class ์๊ธฐ์์ด2 { static int n,m; static int xpos[]= {0,0,1,-1,1,1,-1,-1}; static int ypos[]= {1,-1,0,0,1,-1,-1,1}; static int[][] map; static int[][] dis; public static..
2023. 5. 16. 23:44
์ต๊ทผ๋๊ธ