From 56be6b73f9e6b3a4bfd9db53f0a7644382708ca2 Mon Sep 17 00:00:00 2001 From: sh0723 Date: Tue, 11 Aug 2026 13:13:30 +0900 Subject: [PATCH 1/2] =?UTF-8?q?17825=20:=20=EC=A3=BC=EC=82=AC=EC=9C=84=20?= =?UTF-8?q?=EC=9C=B7=EB=86=80=EC=9D=B4=20solve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/week5/BOJ17825/BOJ17825_V1.cpp | 139 +++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 src/week5/BOJ17825/BOJ17825_V1.cpp diff --git a/src/week5/BOJ17825/BOJ17825_V1.cpp b/src/week5/BOJ17825/BOJ17825_V1.cpp new file mode 100644 index 0000000..f66a5ab --- /dev/null +++ b/src/week5/BOJ17825/BOJ17825_V1.cpp @@ -0,0 +1,139 @@ +#include +using namespace std; +struct horse{ + int index = 0; + int sum = 0; +}; +int dice_turn[10]; +horse ret[4]; +int max_val = INT_MIN; +int int_map[33] = { + 0,2,4,6,8,10, + 12,14,16,18,20, + 13,16,19, + 22,24, + 22,24,26,28,30, + 28,27,26,25, + 30,35, + 32,34,36,38,40, + 0 +}; +vector> link(33, vector()); +void initialization() { + for (int i=0; i<5; i++) { + link[i].push_back(i+1); + } + link[5].push_back(6); + link[5].push_back(11); + for (int i=6; i<10; i++) { + link[i].push_back(i+1); + } + link[11].push_back(12); + link[12].push_back(13); + link[13].push_back(24); + link[10].push_back(16); + link[14].push_back(15); + link[15].push_back(24); + link[10].push_back(14); + for (int i=16; i<20; i++) { + link[i].push_back(i+1); + } + for (int i=21; i<24; i++) { + link[i].push_back(i+1); + } + link[24].push_back(25); + link[25].push_back(26); + link[26].push_back(31); + + link[20].push_back(27); + link[20].push_back(21); + + for (int i=27; i<=31; i++) { + link[i].push_back(i+1); + } +} + +bool can_go(int horse_index, int cnt) { + int st = ret[horse_index].index; + int curr = st; + if (st == 5 || st == 10 || st == 20) { + curr = link[curr][1]; + for (int i=1; i> dice_turn[i]; + initialization(); + solve(0,0); + + cout << max_val; + + + return 0; +} \ No newline at end of file From fbf5d529a4f04a7f4bc38a4a7f2b84f55ac6ebe6 Mon Sep 17 00:00:00 2001 From: sh0723 Date: Tue, 11 Aug 2026 13:16:47 +0900 Subject: [PATCH 2/2] =?UTF-8?q?17825=20:=20=EC=A3=BC=EC=82=AC=EC=9C=84=20?= =?UTF-8?q?=EC=9C=B7=EB=86=80=EC=9D=B4=20CI=20=EC=9D=B4=EB=A6=84=20?= =?UTF-8?q?=EC=B6=A9=EB=8F=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/week5/BOJ17825/BOJ17825_V1.cpp | 54 +++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/week5/BOJ17825/BOJ17825_V1.cpp b/src/week5/BOJ17825/BOJ17825_V1.cpp index f66a5ab..6b1c877 100644 --- a/src/week5/BOJ17825/BOJ17825_V1.cpp +++ b/src/week5/BOJ17825/BOJ17825_V1.cpp @@ -18,38 +18,38 @@ int int_map[33] = { 32,34,36,38,40, 0 }; -vector> link(33, vector()); +vector> board(33, vector()); void initialization() { for (int i=0; i<5; i++) { - link[i].push_back(i+1); + board[i].push_back(i+1); } - link[5].push_back(6); - link[5].push_back(11); + board[5].push_back(6); + board[5].push_back(11); for (int i=6; i<10; i++) { - link[i].push_back(i+1); + board[i].push_back(i+1); } - link[11].push_back(12); - link[12].push_back(13); - link[13].push_back(24); - link[10].push_back(16); - link[14].push_back(15); - link[15].push_back(24); - link[10].push_back(14); + board[11].push_back(12); + board[12].push_back(13); + board[13].push_back(24); + board[10].push_back(16); + board[14].push_back(15); + board[15].push_back(24); + board[10].push_back(14); for (int i=16; i<20; i++) { - link[i].push_back(i+1); + board[i].push_back(i+1); } for (int i=21; i<24; i++) { - link[i].push_back(i+1); + board[i].push_back(i+1); } - link[24].push_back(25); - link[25].push_back(26); - link[26].push_back(31); + board[24].push_back(25); + board[25].push_back(26); + board[26].push_back(31); - link[20].push_back(27); - link[20].push_back(21); + board[20].push_back(27); + board[20].push_back(21); for (int i=27; i<=31; i++) { - link[i].push_back(i+1); + board[i].push_back(i+1); } } @@ -57,17 +57,17 @@ bool can_go(int horse_index, int cnt) { int st = ret[horse_index].index; int curr = st; if (st == 5 || st == 10 || st == 20) { - curr = link[curr][1]; + curr = board[curr][1]; for (int i=1; i