문제는 여기! #include using namespace std; int N, M; int MAP[501][501]; int dx[] = {-1, 1, 0, 0}; int dy[] = {0, 0, -1, 1}; bool isVisited[501][501]; int printCnt = 0, maxCnt = 0; void bfs(int left, int right){ queue q; q.push({left, right}); isVisited[left][right] = true; int cnt = 1; while(!q.empty()){ int x = q.front().first; int y = q.front().second; q.pop(); for(int i=0; i> M; for(int i=0; i MAP..