장애물 인식 프로그램

· C++
이 문제는 딱봐도 DFS느낌이 바로 왔다. 맵에서 1을 만나는 경우 DFS를 이용해서 개수를 찾으면 될 것 같은 느낌이 왔다. 이 아이디어만 있으면 구현부분에서 잘하면 쉽게 풀 수 있는 문제이다. // 딱봐도 DFS #include #include #include #include using namespace std; vector arr; vector collect; vector dx = {1,0,-1,0}; vector dy = {0,1,0,-1}; int howMany = 0; int N; vector split(string &str){ vector line; for (char c : str){ line.push_back(stoi(string(1, c))); } return line; } void df..
Hayden_
'장애물 인식 프로그램' 태그의 글 목록