[BaekJoon] 1012 유기농 배추
·
💯 CodingTest/BaekJoon
▶ 문제 : 더보기 https://www.acmicpc.net/problem/1012 import sys t = int(input()) sys.setrecursionlimit(10**6) def dfs(a, b): if a = m or b = n: return if graph[a][b] == 0: return graph[a][b] = 0 dfs(a - 1, b) dfs(a, b - 1) dfs(a + 1, b) dfs(a, b + 1) for _ in range(t): m, n, k = map(int, input().split()) graph = [[0 for _ in range(n)]for _ in range(m)] for _ in range(k): a, b = ma..