>
>
[BOJ] 14890번 경사로
Sol1) 재귀#include #define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)using namespace std;const int MAXN = 105;int n, l, res;int a[MAXN][MAXN], b[MAXN][MAXN];void solved(int arr[MAXN][MAXN], int i, int j, int cnt){ if (j == n) { res++; return; } int cur = arr[i][j]; int next = arr[i][j + 1]; if (cur == next) solved(arr, i, j + 1, cnt + 1); else i..
[BOJ] 14499번 주사위 굴리기
#include #define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)using namespace std;const int MAXN = 25;int n, m, x, y, k, dir;int arr[MAXN][MAXN], state[6];int dx[] = {0, 0, -1, 1}; // 동서북남 순서int dy[] = {1, -1, 0, 0};bool out_boundary(){ int nx = x + dx[dir]; int ny = y + dy[dir]; return !(nx >= 0 && nx = 0 && ny 0; i--) state[i] = state[i - 1]; state[0] = tm..