[C++] 백준 문제풀이 (Simulation) 11559번 Puyo Puyo
https://www.acmicpc.net/problem/11559 11559번: Puyo Puyo 총 12개의 줄에 필드의 정보가 주어지며, 각 줄에는 6개의 문자가 있다. 이때 .은 빈공간이고 .이 아닌것은 각각의 색깔의 뿌요를 나타낸다. R은 빨강, G는 초록, B는 파랑, P는 보라, Y는 노랑이다. www.acmicpc.net #include const int h = 12; const int w = 6; std::string field[h]; bool visit[h][w]; int ans; const int dy[] = {-1, 1, 0, 0}; const int dx[] = {0, 0, -1, 1}; std::vector save; bool boom; void bfs(int i, int j, ..
[C++] 백준 문제풀이 (Back Tracking) 1405번 미친 로봇
https://www.acmicpc.net/problem/1405 1405번: 미친 로봇 첫째 줄에 N, 동쪽으로 이동할 확률, 서쪽으로 이동할 확률, 남쪽으로 이동할 확률, 북쪽으로 이동할 확률이 주어진다. N은 14보다 작거나 같은 자연수이고, 모든 확률은 100보다 작거나 같은 자 www.acmicpc.net #include bool map[29][29]; int n; int p[4]; int dy[] = {0, 0, 1, -1}; int dx[] = {1, -1, 0, 0}; double part, total; void dfs(int y, int x, int d, double sum) { map[y][x] = true; if (d == n){ part += sum; return; } for (in..