๋ชฉ๋ก์ ์ฒด ๊ธ (1103)
KoreanFoodie's Study

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/17822 ํด๋ต ์ฝ๋ : #include #include using namespace std; typedef struct plate{ int num; bool mark; }plate; typedef struct inst { int pl; int dir; int tile; }inst; int N, M, T; deque plates[51]; inst insts[51]; int dR[4] = { -1, 1, 0, 0 }; int dC[4] = {0, 0, -1, 1}; // ..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/17837 ํด๋ต ์ฝ๋ : #include #include using namespace std; typedef struct chess{ int num; int row; int col; int dir; }chess; int N, K; int color[12][12]; deque map[12][12]; chess chess_pos[10]; int ans; bool flag; int dR[4] = {0, 0, -1, 1}; int dC[4] = {1, -1, 0, 0}; // ..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/17779 ํด๋ต ์ฝ๋ : #include #include using namespace std; typedef struct pos { int row; int col; }pos; int st_r, st_c, d1, d2; int N; int map[20][20]; // mark vote district int vote[20][20]; // number of people in the district int popul[6]; int ans; // 0 : Left, 1 : Up,..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/17142 ํด๋ต ์ฝ๋ : #include #include #include using namespace std; typedef struct pos { int row; int col; } pos; typedef struct vir { int row; int col; int time; } vir; int N, K; int map[50][50]; int backup[50][50]; // total viruses and number pos virus[10]; int num_v; ..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/17140 ํด๋ต ์ฝ๋ : #include #include using namespace std; typedef struct rl_len { int r_l; int c_l; }rl_len; int a_r, a_c, a_k; int map[100][100]; int cnt[101]; rl_len rl; void swap2(int &a, int &b) { int temp = a; a = b; b = temp; } // rotate row and column to use 'sor..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/17143 ํด๋ต ์ฝ๋ : #include #include using namespace std; typedef struct shark { int s; // speed int d; // direction int z; // size }shark; typedef struct pos_s { int r; // row int c; // col int s; // speed int d; // direction int z; // size }pos_s; int dR[4] = {-1, 1, ..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/17144 ํด๋ต ์ฝ๋ : #include #include #include using namespace std; int M, N, T; int map[50][50]; int change[50][50]; int u_row; int d_row; int dR[4] = {0, 0, -1, 1}; int dC[4] = {-1, 1, 0, 0}; bool isRange(int r, int c) { if (r = M || c = N) { return..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/16236 ํด๋ต ์ฝ๋ : #include #include using namespace std; typedef struct pos { int row; int col; }pos; typedef struct route { int row; int col; int dist; } route; typedef struct shark { int row; int col; int s_size; int feed; }shark; int N; int map[20][20]; shark baby; ..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/16235 ํด๋ต ์ฝ๋ : #include #include #include using namespace std; int N, M, K; // number of fertilizer in the cell int map[10][10]; int A[10][10]; deque trees[10][10]; int ans; int dR[8] = {-1, -1, -1, 0, 0, 1, 1, 1}; int dC[8] = {-1, 0, 1, -1, 1, -1, 0, 1}; bool isRan..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/16234 ํด๋ต ์ฝ๋ : #include #include #include #include using namespace std; typedef struct pos { int row; int col; }pos; typedef struct cell { int row; int col; int val; }cell; int map[50][50]; bool bar[50][50][4]; bool merged[50][50]; // check whether people moved or n..