시뮬레이션
-
백준 - 파이프 옮기기 2 [17069]공부/baekjoon 문제 2019. 6. 24. 16:07
#include using namespace std; int map[34][34]; long long road[3][34][34]; int result; void func(int n) { road[0][1][2] = 1; for (int i = 1; i < n + 1; i++) { for (int j = 2; j < n + 1; j++) { if (map[i][j + 1] != 1) { road[0][i][j + 1] = road[0][i][j] + road[1][i][j]; } if (map[i + 1][j] != 1) { road[2][i + 1][j] = road[1][i][j] + road[2][i][j]; } if (map[i + 1][j + 1] != 1 && map[i + 1][j] != 1..
-
백준 - Puyo Puyo [11559]공부/baekjoon 문제 2019. 6. 13. 15:19
#include #include using namespace std; char map[12][6]; bool visit[12][6]; bool check = false; int result = 0; void down(int i, int j) { int top = i; int bot = i; int n = 0; for (int l = i; l >= 0; l--) { if (map[l][j] != '.') { map[bot - n][j] = map[l][j]; map[l][j] = '.'; n++; } } } void boom(int i, int j) { char name = map[i][j]; map[i][j] = '.'; if (i > 0) if (map[i - 1][j] == name) boom(i -..