백준 뿌요뿌요
/*다시 정돈해서 풀어보도록 하겠습니다. 와일(1){1. 뿌요찾아서 터트리기 cnt++; (터뜨릴 뿌요없으면 break)2. 중력을 이용해서 아래 0 없애기}*/ #include #include #include #include #include using namespace std; int map[13][7];int visit[13][7];int x, y, nx, ny;int dx[] = { 0,0,1,-1 };int dy[] = { 1,-1,0,0 };int chain_cnt, zero_cnt;string a;int curNum;int same_color_cnt, flag;struct points {int x, y;};queue que;vector vec; void problemIn() {for (int ..
2018. 2. 22.
백준 3190 뱀
/*뱀 문제 머리를 다음칸에 위치 시킵니다.if 사과 있, 사과를 먹고 꼬리는 그대로else 사과 없, 꼬리가 위치한 칸을 비웁니다.뱀이 죽는데 몇 초가 걸리는지 확인해보세요.*/ #include #include #include #define SIZE 101using namespace std;int n, k, l;char c;int x, y, nx, ny, d;int dx[] = { 0,0,1,-1 };int dy[] = { 1,-1,0,0 }; // 동서남북int sec;int a, b;int map[SIZE][SIZE];struct points {int x;int y;};queue dir_info;queue snake; void problemIn() {cin >> n >> k; // 맵의 크기, 사과..
2018. 2. 21.
백준 연구소 문제 다시 풀어보기
#include #include #include using namespace std;#define SIZE 8int map[SIZE][SIZE];int map_store[SIZE][SIZE];int check[SIZE][SIZE];struct points {int x, y;};queue que;int dx[] = { 0,0,1,-1 };int dy[] = { 1,-1,0,0 };int x, y, nx, ny, n, m;int wall;int maxVal;int safe_cnt; void copy_map(int(*a)[SIZE], int(*b)[SIZE]) {for (int i = 0; i < n; i++) {for (int j = 0; j < m; j++) {b[i][j] = a[i][j];}}} voi..
2018. 2. 20.