| 알고리즘 | 3 | 그래프-1 | Stack : DFS | 미로찾기 |
·
PS/알고리즘
미로찾기 스택큐 노트로 돌아가기 https://felipuss.tistory.com/entry/니앙팽이-자료구조-2-스택큐-노트?category=961476 1. stack을 이용한 DFS #include #include #include #include #include #include #define pr pair #define y first #define x second using namespace std; int arr[1010][1010] = {0, }; bool visit[1010][1010] = { false, }; pr MV[8] = { {0,-1},{1,-1},{1, 0},{1,1}, {0,1},{-1,1},{-1,0},{-1,-1} }; bool isEnter(pr _pos, int _N) ..