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

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/13460 ํด๋ต ์ฝ๋ : #include #include #include using namespace std; int N, M; char map[10][10]; int ans; bool b_hole; // true if blue goes down to hole // Up, Down, Left, Right // right, down, left, up int dR[4] = {0, 1, 0, -1}; int dC[4] = {1, 0, -1, 0}; void copy_map(c..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWXRFInKex8DFAUo ํด๋ต ์ฝ๋ : #include #include #include using namespace std; typedef struct atom { int x; int y; int dir; int energy; }atom; typedef struct crush { int in1; // index of atoms[1001] int in2; int min_time_2; //..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWXRJ8EKe48DFAUo ํด๋ต ์ฝ๋ : #include #include #include using namespace std; typedef struct cell { int row; int col; int deact; int act; int X; }cell ; typedef struct info { int alloc; int X; }info; int M, N, K; int dR[4] = ..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/14891 ํด๋ต ์ฝ๋ : #include #include #include using namespace std; int K; deque gear[4]; int dir[4]; // direction of each gear // 1 : clockwise // -1 : counter-clockwise // 0 : stay still // clockwise turn void clock(deque g) { int temp = g.back(); g.pop_back(); g.push_..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV597vbqAH0DFAVl ํด๋ต ์ฝ๋ : #include #include #include using namespace std; typedef struct micro { int row; int col; int num; // ๋ฏธ์๋ฌผ์ ๊ฐฏ์ int dir; // ์ ํ ์ข ์ฐ ๊ฐ๊ฐ 0 1 2 3 bool same; } micro; int N, M, K; int org_sum; // ์, ํ, ..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWIeW7FakkUDFAVH ํด๋ต ์ฝ๋ : #include #include #include using namespace std; int N, X; int map[20][20]; int num_road; bool isRange(int x) { if (x = N) { return false; } else return true; } // change x-y coordinates..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5-BEE6AK0DFAVl& ํด๋ต ์ฝ๋ : // c++ #include #include #include using namespace std; vector people; vector stair; int N; int board[10][10] = { 0, }; int mappingTable[10]; int answer; int peopleCnt; int getTime() { int t = 0;..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/14503 ํด๋ต ์ฝ๋ : // c++ #include using namespace std; #define MAX 51 int N, M; int input[MAX][MAX]; int x, y; int result; int direction; //๋ถ, ๋, ๋จ, ์ int dx[] = { -1, 0, 1, 0 }; int dy[] = { 0, 1, 0, -1 }; int main() { cin >> N >> M; cin >> x >> y >> direction; for (i..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : www.acmicpc.net/problem/2583 ํด๋ต ์ฝ๋ : #include #include #include using namespace std; typedef struct pos { int row; int col; } pos; int M, N, K; int divided; int map[100][100]; pos rec[100][2]; // up, right, down, left int dX[4] = { 0, 1, 0, -1 }; int dY[4] = { -1, 0, 1, 0 }; bool isRange(..

SW ์ญ๋ ํ ์คํธ ์ค๋น๋ฅผ ์ํ ํต์ฌ ๋ฌธ์ ๋ค์ ๋ค๋ฃน๋๋ค! ํด๋ต์ ๋ณด๊ธฐ ์ ์ ๋ฌธ์ ๋ฅผ ํ์ด๋ณด์๊ฑฐ๋, ์ค๊ณ๋ฅผ ํ๊ณ ์ค์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. ์ฝ๋์ ๋ํ ์ค๋ช ์ ์ฃผ์์ ์ฐธ๊ณ ํด ์ฃผ์ธ์ :) ๋ฌธ์ ๋งํฌ : swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5V61LqAf8DFAWu ํด๋ต ์ฝ๋ : #include #include #include #define _CRT_SECURE_NO_WARNINGS using namespace std; int N, M; int map[20][20]; int max_houses; // number of houses int house; // ์ต๋ potential K ๊ฐ int K; typedef struct..