https://www.acmicpc.net/problem/1058코드 #include #include #include using namespace std;#define MAX 51#define FASTIO ios::sync_with_stdio(false); cin.tie(NULL);typedef pair pi;int n, ans;char arr[MAX][MAX];bool visit[MAX];void bfs(int s) { queue q; q.push({ s, 0 }); visit[s] = 1; int cnt = 0; while (!q.empty()) { int now = q.front().first; int d = q.front().second; q.pop(); if (d > 1) continu..