https://www.acmicpc.net/problem/1743 문제를 보고 바로 BFS를 이용해 상하좌우에 이어진 쓰래기를 탐색해 최대(Max)를 구하면되겠다고 생각했다. 처음 코드 (메모리 초과)from collections import dequeimport sysinput = sys.stdin.readlinedx = [-1, 1, 0, 0]dy = [0, 0, -1, 1]result = 0n, m, k = map(int, input().split())trash = [[False]*m for _ in range(n)]for _ in range(k): x, y =map(int, input().split()) trash[x-1][y-1] = Truedef bfs(x, y): cnt = ..