[백준] 29634번 Hotel
·
백준 문제/BFS
문제: 29634번: Hotel #include using namespace std;vector> board;vector> visits;int dx[4] = { -1, 0, 1, 0 };int dy[4] = { 0, -1, 0, 1 };int n, m; // 높이, 너비long long BFS(pair start) { long long size = 0; queue> nexts; nexts.push(start); visits[start.first][start.second] = true; while (!nexts.empty()) { pair cur = nexts.front(); nexts.pop(); size++; for (int i = 0; i n - 1 || ny m - 1) continue;..