[3184번] 양
3184번: 양 www.acmicpc.net /*3184번 양*/ #include #include #include using namespace std; struct pnt { int rr, cc; }temp; int R, C; string Map[250]; int area_chk[250][250]; queuewolf_Q; queuesector; int wolf, sheep, wolf_cnt, sheep_cnt; int drc[] = { 0,0,-1,1,-1,1,0,0 }; int area_bfs(int r,int c) { temp.rr = r; temp.cc = c; sector.push(temp); if (Map[r][c] == 'v') { wolf_cnt = 1; sheep_cnt = 0; } els..
2019. 2. 11.
[2174번] 로봇 시뮬레이션
2174번: 로봇 시뮬레이션 www.acmicpc.net #include #include using namespace std; int A, B, N, M;//가로(열), 세로(행), 로봇 수, 명령어 수 int Map[101][101]; struct Robot { int r, c, dir; }Rbt[101];//로봇 방향 저장, 배열의 번호 = 로봇 넘버 (1번째 배열부터 사용) struct Commend { int R_num; char commd; int times; }temp; queueQ; int select_R, crashed_R; bool crash_flag = 0; int chk(int r_num, int r, int c) { //반환값 0 : 정상 , 1:벽충돌, 2:로봇끼리 충돌 selec..
2019. 1. 17.