전체 글128 dovelet) maze 최단 거리 미로 #include #pragma warning(disable:4996) char map[100][100];int visited[100][100];int len = 1000;int n, m; void maze(int x, int y, int min){ map[x][y] = '1'; if (x == 0 && y == m - 1) { if (len > min) len = min; } if (map[x - 1][y] == '0') { maze(x - 1, y, min + 1); } if (map[x + 1][y] == '0') { maze(x + 1, y, min + 1); } if (map[x][y + 1] == '0') { maze(x, y + 1, min + 1); } if (map[x][y - 1] == .. 2015. 8. 25. uva_10074) Take the Land #include using namespace std; int n, m;int map[105][105]; int gg(int a, int b, int count){ if (b > testcase; while (testcase--) { cin >> n >> m; for (int i = 0; i num; if (num == 0) map[i][j] = 1; else map[i][j] = 2; } } int garo; int sero; int mul = 0; int max = 0; for (int i = 0; i 2015. 8. 21. 이전 1 ··· 19 20 21 22 다음