본문 바로가기

백준52

[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.
[15683번] 감시 15683번: 감시 www.acmicpc.net /*15683번 감시*/ #include #include #include using namespace std; struct Cam{ int r, c, dir, kinds; }temp[8]; //dir U:0, R:1, D:2, L:3 int Map[8][8]; int N, M; int cam_cnt; int Min_B = 100; bool chk(int r, int c) { if (!(r = N || c = M)) { if (Map[r][c] != 6) return true; else return false; } else return false; } void UP(int r,int c){ int rr = r; int cc.. 2019. 1. 23.
[11506번] 占쏙옙 11506번: 占쏙옙 www.acmicpc.net 백준 7대 난제 중 하나. 답을 찾고도 내가 간과했던 부분은 답은 "문자열"이다. 아무 생각도 없이 문자로 취급해서 계속 틀렸었다 .... 심심할 때 풀어보자 ㅎㅎ 2019. 1. 17.
[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.