1. dfs를 통해 각 cctv의 방향에 따른 조합을 구합니다. 2. 조합으로 만들어진 cctv_set을 통해 색칠하는 식으로 감시영역을 구합니다. import sys input = sys.stdin.readline def check_zero_area(cctvs): tmp = [[1]*M for _ in range(N)] q = [] for cctv in cctvs: init_x, init_y, cctv_id, cctv_dir = cctv tmp[init_x][init_y] = 0 dirs = cctv_setting[cctv_id][cctv_dir] for d in dirs: q.append((init_x, init_y)) while q: x, y = q.pop() nx = x + delta[d][0] ..