본문 바로가기

분류 전체보기439

새로운 게임 2 https://www.acmicpc.net/problem/17837 17837번: 새로운 게임 2 재현이는 주변을 살펴보던 중 체스판과 말을 이용해서 새로운 게임을 만들기로 했다. 새로운 게임은 크기가 N×N인 체스판에서 진행되고, 사용하는 말의 개수는 K개이다. 말은 원판모양이고, 하 www.acmicpc.net #include #include using namespace std; const int MAX = 13; int map[MAX][MAX]; //색깔 저장 int n, k; int answer = 0; struct INFO { int num, x, y, dir; }; vector horse; vector loc[MAX][MAX]; //말 위치 저장 struct MOVE { int x, y; };.. 2021. 4. 20.
주사위 윷놀이 C++ https://www.acmicpc.net/problem/17825 #include #include using namespace std; int dice[10]; pair horse[4]; //루트, 인덱스 int way1[22] = { 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,41 }; int way2[9] = { 10,13,16,19,25,30,35,40,41}; int way3[8] = { 20,22,24,25,30,35,40,41}; int way4[9] = { 30,28,27,26,25,30,35,40,41}; int way5[5] = { 25,30,35,40,41 }; vector v; int MoveDice(int count, i.. 2021. 4. 20.
원판 돌리기 https://www.acmicpc.net/problem/17822 17822번: 원판 돌리기 반지름이 1, 2, ..., N인 원판이 크기가 작아지는 순으로 바닥에 놓여있고, 원판의 중심은 모두 같다. 원판의 반지름이 i이면, 그 원판을 i번째 원판이라고 한다. 각각의 원판에는 M개의 정수가 적혀 www.acmicpc.net #include #include using namespace std; const int MAX = 51; int n, m, t; int x, d, k; int circle[MAX][MAX]; int temp[MAX][MAX]; int visited[MAX][MAX]; struct MOVE { int x,y; }; MOVE mv[4] = { {-1,0}, {1,0}, {0,1}, {.. 2021. 4. 20.
모노미노도미노2 C++ #include #include using namespace std; int n; int red[4][4]; int blue[4][6]; int green[6][4]; int answer = 0; pair MoveBlock_Blue(int x, int y) { int movej = 0; while (movej = 0; i--) { for (int j = 0; j = 0; i--) { for (int j = .. 2021. 4. 18.