백준 14500 테트로미노
#pragma warning(disable:4996) #include#include#define MAX 502using namespace std; int map[MAX][MAX];bool visit[MAX][MAX];int n, m, tmp;int dx[4] = { 0,0,1,-1 };int dy[4] = { 1,-1,0,0 }; int dfs(int x, int y, int d) {if (d == 4) return map[x][y]; visit[x][y] = 1;int ret = 0;for (int i = 0; i < 4; i++) {int nx = x + dx[i];int ny = y + dy[i];if (nxm) continue;if (visit[nx][ny]) continue;tmp = dfs(n..
2017. 10. 21.
백준 14502 연구소
#pragma warning(disable:4996) #include#include#include#include #define MAX 8 using namespace std; int map[MAX][MAX];int n, m;bool visit[MAX][MAX];int max_value;int dx[4] = { 0, 0, 1, -1 };int dy[4] = { 1, -1, 0, 0 }; vector virus; void input() {scanf("%d %d", &n, &m);for(int i=0; i= m || map[nx][ny] != 0) continue;map[nx][ny] = 2;q.push(make_pair(nx, ny));}}} void dfs(int x, int y, int d) {map[x..
2017. 10. 21.