백준 6593번 상범 빌딩
https://www.acmicpc.net/problem/6593 아이디어:1. 3차원 BFS2. board[z][x][y], int dz[6] = { 1, -1, 0, 0, 0, 0 }; int dx[6] = { 0, 0, 1, 0, -1, 0 }; int dy[6] = { 0, 0, 0, 1, 0, -1 };, int nz, nx, ny 순서에 주의3. tuple 사용 #include #include using namespace std;char board[31][31][31];int vis[31][31][31];int dz[6] = { 1, -1, 0, 0, 0, 0 };int dx[6] = { 0, 0, 1, 0, -1, 0 };int dy[6] = { 0, 0, 0, 1, 0, -1 };int m..
백준 2468번 안전 영역
https://www.acmicpc.net/problem/2468 아이디어:1. BFS 순환에 조건 추가2. 1~100 순환보다 더 적게하기 위해 높이 중 최소값과 최대값을 구하여 그 사이에서 순환3. board[i][j] 4. 영역 개수의 최대값을 출력 #include #include using namespace std;int board[101][101];int vis[101][101];int dx[4] = { 1, 0, -1, 0 };int dy[4] = { 0, 1, 0, -1 };int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); queue> Q; int n, tmp, ans = 0, maxi = 0, mini = 100; cin >>..