알고리즘8 [백준14503/시뮬레이션] 로봇 청소기 문제풀이 구상 -> while문을 돌면서 전진시 방위 덧셈, 후진시 방위 뺄셈 1트 public class simulation14503 { static int N; static int M; static int[][] room; static int[] nowPoint; static int side; static int[] dy = {-1, 0, 1, 0}; //우하좌상 동남서북 -> 북동남서0123 static int[] dx = {0, 1, 0, -1}; static int cleanUpCount; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); // 첫 줄에서 N과 M을 읽어옵니다. N = scanner.. 2023. 11. 14. bfs, dfs 함수에서 (y,x)로 받아주는 이유 def dfs(y, x): global each each += 1 for k in range(4): ny = y + dy[k] nx = x + dx[k] if 0 2023. 11. 14. 이전 1 2 다음