[ BOJ ] 구슬 탈출 2
/ 구현 1 / n, m = map(int, input().split()) board = [list(input()) for _ in range(n)] for i in range(n): for j in range(m): if board[i][j] == 'R': red = [i, j] elif board[i][j] == 'B': blue = [i, j] elif board[i][j] == 'O': hole = [i, j] movePossible = True count = 0 dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] def roll(i, ball): nx = ball[0] + dx[i] ny = ball[1] + dy[i] if board[nx][ny] != '#': return [..
[ 백준 / BOJ ] 16924 십자가 찾기
/ 제출 1 / n, m = map(int, input().split()) answer = [] board = [] # 상 하 좌 우 dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] cannot = [] for i in range(n): board.append(list(input().strip())) for x in range(n): for y in range(m): if board[x][y] == '*': size = 1 check = True while check: # check 4 directions for i in range(4): nx = x + dx[i] * size ny = y + dy[i] * size if nx < 0 or n 0: answer.append([x, y,..