#include using namespace std;#define north 0#define east 1#define south 2#define west 3 struct robot {int y;int x;int dir;}; int dy[4]={0, -1, 0, 1};int dx[4]={-1, 0, 1, 0};int ry[4]={1, 0, -1, 0};int rx[4]={0, -1, 0, 1};int main(){int N, M;cin >> N >> M; int map[50][50] ; /*initialization*/ for(int i=0; i R.y>> R.x >> R.dir; int cnt = 0;int checker=0;for (int i = 0; i map[i][j]; while (1) { /*현..
//https://www.acmicpc.net/problem/13460 #include #include using namespace std; #define UP 0#define DOWN 1#define LEFT 2#define RIGHT 3 class ball{public : int x; int y; ball(int _x=0, int _y=0) : x(_x), y(_y) {}};char map[10][10];char cache[11][10][10];int N, M;int mn=11; ball R;ball B;int chk; //map inputvoid input(){ cin >> N >> M; for(int i=0; i map[i][j]; if(map[i][j]=='R'){ R.y=i; R.x=j; } ..
//https://www.acmicpc.net/problem/14716 #include #include #include using namespace std; bool map[250][250];//bool visited[250][250]; int N, M;int dy[8]={-1,-1,-1,0,0,1,1,1};int dx[8]={-1,0,1,-1,1,-1,0,1}; void input();void bfs(int y, int x); int main(){ int ans=0; input(); for(int i=0; i>N; for(int i=0; i map[i][j]; } }} void bfs(int y, int x){ queue q; q.push(make_pair(y, x)); map[y][x]=0; whil..