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

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/5373 ํด๋ต ์ฝ๋ : #include #include using namespace std; char up[9]; char down[9]; char front[9]; char back[9]; char left_my[9]; char right_my[9]; char ans[100][9]; void rotate_surface(char sur, char dir) { char temp[9]; if (sur == 'U') { copy(up, up + 9, temp); if (dir..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/15685 ํด๋ต ์ฝ๋ : #include #include #include #include using namespace std; int map[101][101] = { false }; int N; int ans; typedef struct dragon { int st_row; int st_col; int end_row; int end_col; int dir; int gen; } dragon; vector dragons; int dR[4] = {0, -1, 0, 1}; in..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/15683 ํด๋ต ์ฝ๋ : #include #include #include #include using namespace std; typedef struct cctv { int row; int col; int num; int dir; } cctv; int N, M; int map[8][8]; // Up, Right, Down, Left int dR[4] = {-1, 0, 1, 0}; int dC[4] = {0, 1, 0, -1}; vector cctvs; vector cct..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/14889 ํด๋ต ์ฝ๋ : #include #include #include #include using namespace std; int N; int map[20][20]; int p_sum[20][20]; // divide team to 'start' and 'link' // 0 : 'start', 1 : 'link' int divide[20]; int ans; // compute difference, using divide[20] void compute_diff() { ..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/14888 ํด๋ต ์ฝ๋ : #include #include using namespace std; int N; int numbers[15]; int op[15]; int ans_min; int ans_max; int operate(int o1, int o2, int oper) { if (oper == 0) { return (o1 + o2); } else if (oper == 1) { return (o1 - o2); } else if (oper == 2) { return (o..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/14501 ํด๋ต ์ฝ๋ : #include #include #include #include using namespace std; typedef struct table { int time; int price; } table; int N; table consult[17]; int max_val[30]; int main() { cin >> N; table input; int t_in, p_in; int ans = 0; int temp; fill(max_val, max_val +..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/14499 ํด๋ต ์ฝ๋ : #include #include #include using namespace std; typedef struct pos { int row; int col; } pos; // Use this for 'dice', d1~d6 => element from the top typedef struct dice_map { pos d_pos; int north; int west; int up; int east; int south; int down; }dice_..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/13458 ํด๋ต ์ฝ๋ : #include #include using namespace std; int N, B, C; vector rooms; int main() { long long ans = 0L; int t; int n; cin >> N; for (int i =0; i > n; rooms.push_back(n); } cin >> B >> C; for (int i =0; i < N; i++) { t = rooms[i]; t -= B; a..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/3190 ํด๋ต ์ฝ๋ : #include #include #include #include using namespace std; typedef struct turn { int sec; char dir; }turn; typedef struct pos { int row; int col; }pos; int N, K, L; int map[101][101]; deque t_list; deque snake; // Up, Down, Left, Right int dR[4] = {-1, 1..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/12100 ํด๋ต ์ฝ๋ : #include #include using namespace std; int N; int ans; int map[20][20]; // Up, Down, Left, Right int dR[4] = {-1, 1, 0, 0}; int dC[4] = {0, 0, -1, 1}; void copy_map(int dst[20][20], int src[20][20]) { for (int i = 0; i < N; i++) { for (int j = 0; j < ..