백준 미세먼지 안녕 C++
#include #include #include using namespace std; const int MAX = 1001; int r, c, t; int air[MAX][MAX]; int copyair[MAX][MAX]; int copys[MAX][MAX]; vector cleanmachine; struct Move { int x, y; }; Move mv[4] = { {1,0}, {0,1}, {0,-1}, {-1,0} }; void dfs(int i, int j) { int spread = int(copyair[i][j] / 5); int count = 0; for (int k = 0; k < 4; k++) { int movei = i + mv[k].x; int movej = j + mv[k].y; ..
2019. 10. 15.
백준 2468번 C++
#include #include #include using namespace std; const int MAX = 101;int n;int arr[MAX][MAX];int visited[MAX][MAX];typedef struct {int a, b;}Move;Move mv[4] = { {1,0},{-1,0},{0,1},{0,-1} }; void dfs(int i,int j,int h) {for (int k = 0; k = 0 && mi = 0 && mj h && visited[mi][mj] == -1) {visited[mi][mj] ..
2019. 2. 25.