diff --git a/week09/wonkyDD/.gitkeep b/week09/wonkyDD/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/week09/wonkyDD/14500.cpp b/week09/wonkyDD/14500.cpp new file mode 100644 index 0000000..8620e7f --- /dev/null +++ b/week09/wonkyDD/14500.cpp @@ -0,0 +1,74 @@ +#include +using namespace std; +#define MAX 500 +int N,M; +int map[MAX][MAX]; +bool visited[MAX][MAX]; +int dy[] = {-1, 1, 0, 0}; +int dx[] = {0, 0, -1, 1}; +int ans = 0; + +bool check(int y, int x) { + return y>=0 && y=0 && x> N >> M; + for (int i=0; i> map[i][j]; + } + } + + for (int i=0; i +#include +using namespace std; +#define MAX 64 +int N; +char map[MAX][MAX]; + +void dfs(int y, int x, int len) { + // NOTE : 길이가 1이면 압축 불가능 + if (len == 1) { + cout << map[y][x]; + return; + } + + bool flag = true; + char c = map[y][x]; + // NOTE : 모든 dfs 깊이마다 압축 가능한지 여부를 판단한다 + for (int i=y; i> N; + for (int i=0; i> map[i][j]; + } + } + + dfs(0, 0, N); + return 0; +} \ No newline at end of file