백준 / 10026번 / 적록색약 / python 파이썬
·
Coding Test/Baekjoon
문제 : https://www.acmicpc.net/problem/10026 나의 풀이import syssys.setrecursionlimit(10000)input = sys.stdin.readlinen = int(input())grid = [list(input().strip()) for _ in range(n)]visited = [[False] * n for _ in range(n)]dx = [-1, 1, 0, 0]dy = [0, 0, -1, 1]def dfs(x, y, color, board): visited[x][y] = True for i in range(4): nx = x + dx[i] ny = y + dy[i] if 0 DFS/BFS로 풀..