>
>
[BOJ] 15685번 드래곤 커브
Sol1) 방향을 기준으로 string 만들기#include #define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)using namespace std;int n, x, y, d, g, res;bool visited[105][1005];int dx[] = {1, 0, -1, 0};int dy[] = {0, -1, 0, 1};int main(){ FASTIO; cin >> n; for (int i = 0; i > x >> y >> d >> g; string tmp = to_string(d); for (int j = 0; j 시계 방향으로 90도를 돌린다는 것은 기준점의 관점에서는 반시계..
[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..