4677 Oil Deposit
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152#include #include char arr[105][105] = { 0 };char chk[105][105] = { 0 }; int dx[8] = { 0,1,1,1,0,-1,-1, -1 };int dy[8] = { 1,1,0,-1,-1,-1,0, 1 };void dfs(int y, int x, int row, int col) { chk[y][x] = 1; for (int i = 0; i
2020. 1. 14.
7569 토마토
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869#include #include #include using namespace std; queue q;// (date, h), (y,x) int dx[6] = {1,-1,0,0,0,0};int dy[6] = {0,0,1,-1,0,0};int dh[6] = {0,0,0,0,1,-1};int arr[105][105][105] = { 0 };int chk[105][105][105] = { 0 };void bfs(int col, int row, int height, int sum) { ..
2020. 1. 14.