프로그래머스 리코쳇 로봇 C++
#include #include #include #include using namespace std; int visited[101][101]; int stx, sty; int row_length, col_length; int dx[4]= {-1, 1, 0, 0}; int dy[4]={0, 0, -1, 1}; int bfs(vector board){ queue q; visited[sty][stx]=0; q.push({stx, sty}); while (!q.empty()){ int x = q.front().first; int y = q.front().second; q.pop(); if (board[y][x]=='G'){ return visited[y][x]; } for (int i=0;i=0 &&nx+dx[..
2023.09.17