백준 1012번 유기농배추.
#include #include #include using namespace std; typedef struct { int position_x; int position_y; }earth_bug; int test_case; int N, M, K; bool visit[51][51]; int x, y; int Map[51][51]; int result; int dirx[4] = { 0,0,-1,1 }; int diry[4] = { 1,-1,0,0 }; queue q; void Input() { scanf("%d", &test_case); for (int i = 0; i < test_case; i++) { for (int c = 0; c < 51; c++) { for (int y = 0; y < 51; y++)..
백준 7576 토마토
그냥 눈대중으로 풀었다. 첫번째로 푼것 : #include #include #include #include #include using namespace std; typedef struct { int position; int time; }tomato; int M, N; int Map[1000][1000]; queue q; int min_count; int dirx[4] = { 0,0,1,-1 }; int diry[4] = { -1,1,0,0 }; clock_t start, endi; void Input() { scanf("%d %d", &M, &N); for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { scanf("%d", &Map[i][j]); if..