
https://www.acmicpc.net/problem/4991 코드#include #include #include using namespace std;#define MAX 21#define FASTIO ios::sync_with_stdio(false); cin.tie(NULL);typedef pair, pair> pi;int w, h, dirty = 0, rx, ry;int arr[MAX][MAX], dx[4] = { 1,-1,0,0 }, dy[4] = { 0,0,1,-1 };bool visit[MAX][MAX][1 q; q.push({ {rx,ry},{0, 0} }); while (!q.empty()) { int nx = q.front().first.first; int ny = q.front(..