Algorithm/Graph - BFS (3) 썸네일형 리스트형 HANOI4B #include #include #include #include #include using namespace std; #define PILLAR_COUNT 4 #define DISK_NUM_INFINITE 999999 #define PILLAR_1_MASK 0xFFF0000000000000 #define PILLAR_2_MASK 0x000FFF0000000000 #define PILLAR_3_MASK 0x000000FFF0000000 #define PILLAR_4_MASK 0x000000000FFF0000 unsigned int diskCnt = 0; struct State { unsigned long long disks; unsigned int minDiskIdx[PILLAR_COUNT]; State(.. CHILDRENDAY #include #include #include #include #include using namespace std; int append(int here, int edge, int mod); string gifts(vector digits, int n, int m); int main() { int caseNum = 0; cin >> caseNum; for (int cIter = 0; cIter > allowedDigits >> n >> m; vector digits; while (allowedDigits != 0) { digits.push_back(allowedDigits % 10); a.. SORTING GAME #include #include #include #include #include using namespace std; int bfs(vector& perm); int main() { int caseNum; cin >> caseNum; cin.ignore(); for (int cIter = 0; cIter > n; vector items; int input_item; for (int nIter = 0; nIter > input_item; items.push_back(input_item); } int shortest_distance = bfs(items); cout 이전 1 다음