[백준] 18428번, 감시 피하기 (Python)
·
알고리즘/백준
문제 https://www.acmicpc.net/problem/18428 18428번: 감시 피하기 NxN 크기의 복도가 있다. 복도는 1x1 크기의 칸으로 나누어지며, 특정한 위치에는 선생님, 학생, 혹은 장애물이 위치할 수 있다. 현재 몇 명의 학생들은 수업시간에 몰래 복도로 빠져나왔는데, 복 www.acmicpc.net 코드 import collections import sys input = sys.stdin.readline n = int(input()) graph = [list(input().split()) for _ in range(n)] dx,dy = [-1,1,0,0], [0,0,-1,1] queue = collections.deque() check = False def bfs(): visi..