Algorithm/Graph - DFS (2) 썸네일형 리스트형 GALLERY #include #include #include #include using namespace std; bool **gAdj; int galleryNum = 0, hallwayNum = 0; vector visited; const int UNWATCHED = 0; const int WATCHED = 1; const int INSTALLED = 2; int installCount = 0; int dfsForInstall(int here); int installCamera(); int main() { int caseNum = 0; cin >> caseNum; cin.ignore(); for (int cIter = 0; cIter < caseNum; cIter++) { #pragma region READ INP.. DICTIONARY #include #include #include #include #include using namespace std; vector adj; vector visited; vector phase; // 위상 vector words; void makeGraph(); vector topologicalSort(); void dfs(int here); int main() { int caseNum = 0; cin >> caseNum; for (int i = 0; i > wordCnt; cin.ignore(); for (int j = 0; j < wordCnt; j++) { string word; std::getline(std::cin, word).. 이전 1 다음