diff --git a/src/week5/BOJ17825/BOJ17825_V1.cpp b/src/week5/BOJ17825/BOJ17825_V1.cpp new file mode 100644 index 0000000..6b1c877 --- /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> board(33, vector()); +void initialization() { + for (int i=0; i<5; i++) { + board[i].push_back(i+1); + } + board[5].push_back(6); + board[5].push_back(11); + for (int i=6; i<10; i++) { + board[i].push_back(i+1); + } + 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++) { + board[i].push_back(i+1); + } + for (int i=21; i<24; i++) { + board[i].push_back(i+1); + } + board[24].push_back(25); + board[25].push_back(26); + board[26].push_back(31); + + board[20].push_back(27); + board[20].push_back(21); + + for (int i=27; i<=31; i++) { + board[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 = board[curr][1]; + for (int i=1; i> dice_turn[i]; + initialization(); + solve(0,0); + + cout << max_val; + + + return 0; +}