백준 :: BOJ :: 5373 :: 큐빙 출처 : https://www.acmicpc.net/problem/5373 #include using namespace std;int T, N, i, h,c[21] = {13,8,3,18,14,9,4,0,19,15,10,5,1,20,16,11,6,2,17,12,7 },u[6][21] = {{ 20,19,18,27,8,7,6,11,28,5,4,3,10,29,2,1,0,9,45,46,47 },{ 18,21,24,6,11,14,17,36,3,10,13,16,39,0,9,12,15,42,47,50,53 },{ 6,7,8,11,18,19,20,27,14,21,22,23,30,17,24,25,26,33,36,37,38 },{ 26,23,20,38,33,30,27,8,41,..
백준 :: BOJ :: 15686 :: 치킨 배달 출처 : https://www.acmicpc.net/problem/15686 #include using namespace std; struct s {int r, c, ch;};int N, M, tmp, ans;vector h, c;vectora;vector hh; void dfs(int n, int ii) {if (n == M) {int r = 0;for (int i = 0; i < h.size(); i++) {int rr = 1e9;for (int j = 0; j < a.size(); j++) {rr = min(rr, hh[i][a[j]]);}r += rr;}ans = min(ans, r);return;} for (int i = ii; i < c.siz..
백준 :: BOJ :: 15685 :: 드래곤 커브 출처 : https://www.acmicpc.net/problem/15685 #include using namespace std; struct dc {int x, y, d, s;};int N, ans, arr[101][101]; dc p;int dx[] = {1,0,-1,0}, dy[] = {0,-1,0,1};bool visited[101][101];vector v; vector dir; inline bool check(int x, int y) { return arr[y][x] && arr[y + 1][x] && arr[y][x + 1] && arr[y + 1][x + 1] ? true : false; } void cal() {dir.push_back(..
백준 :: BOJ :: 14499 :: 주사위 굴리기 출처 : https://www.acmicpc.net/problem/14499 #include using namespace std; int N, M, x, y, K;int arr[20][20];vectordice = { 0,0,0,0,0,0 };int dx[] = {0,1,-1,0,0}, dy[] = {0,0,0,-1,1}; inline bool check(int i, int j) { return i >= 0 && j >= 0 && i < N && j < M ? true : false; } void Rolling(int d) {vectortmp(dice);if (d == 1) {dice[0] = tmp[3]; dice[2] = tmp[0]; dice[3..
백준 :: BOJ :: 7576 :: 토마토 출처 : https://www.acmicpc.net/problem/7576 #include using namespace std; struct a {int i, j;};int N, M, ans, result;int arr[1000][1000];int di[] = { 0,0,1,-1 }, dj[] = {1,-1,0,0};bool visited[1000][1000];queue q; inline bool check(int i, int j) { return (i >= 0 && j >= 0 && i < N && j < M) ? true : false; } int bfs() {if (ans == 0) return 0;while (!q.empty()) {int t = q.s..
백준 :: BOJ :: 2178 :: 미로탐색 출처 : https://www.acmicpc.net/problem/2178 #include using namespace std; struct a {int i, j, c;};int N, M, ans;int arr[101][101];int di[] = { 0,0,1,-1 }, dj[] = {1,-1,0,0};bool visited[101][101]; inline bool check(int i, int j) { return (i > 0 && j > 0 && i N >> M; ans = 0;for (int i = 1; i
백준 :: BOJ :: 2468 :: 안전 영역 출처 : https://www.acmicpc.net/problem/2468 #include #include #include #include using namespace std; int N, maxH, cnt, ans;int map[100][100];bool visited[100][100];int dir[4][2] = { {-1,0},{0,1},{1,0},{0,-1} };queue q; inline bool check(int i, int j, int h) { return ((i>=0 && j>=0 && i> N; maxH = 0; ans = 1;for (int i = 0; i >..
백준 :: BOJ :: 2589 :: 보물섬 출처 : https://www.acmicpc.net/problem/2589 #include #include #include #include using namespace std; int N, M, ans;int map[50][50];int depth[50][50];bool visited[50][50];int dir[4][2] = { {-1,0},{0,1},{1,0},{0,-1} };queue q; inline bool check(int i, int j) { return ((i>=0 && j>=0 && i N >> M; ans = 0;char c;for (int i = 0; i > c..
BOJ :: 백준 :: 2174 :: 로봇 시뮬레이션 출처 : https://www.acmicpc.net/problem/2174 #include #include using namespace std; struct R {int i, j, d;int r, c, n;};int N, M, n1, n2, map[101][101];int dd[4][2] = { {-1,0},{0,1},{1,0},{0,-1} };R ro[101], co[101]; int main() {std::ios::sync_with_stdio(false); cin.tie(0); cin >> M >> N; cin >> n1 >> n2; char tmp;for (int i = 1; i > ro[i].j >> ro[i].i >> tmp;if (tmp =..
BOJ :: 백준 :: 1103 :: 게임 출처 : https://www.acmicpc.net/problem/1103 #include #include using namespace std; int N, M;int map[51][51], dp[51][51];bool visited[51][51];int dir[4][2] = { {1,0},{-1,0},{0,1},{0,-1} }; inline bool check(int i, int j) { return ((i >= 0 && j >= 0 && i < N && j < M) ? true : false); } int dfs(int i, int j) {if (!check(i, j) || map[i][j] == 999) return 0;if (visited[i][j]) {..
- Total
- Today
- Yesterday
- 17142
- 17144
- 백준
- 연구소 3
- 17143
- hackerrank
- DP
- 시간 복잡도
- 17140
- 2018 카카오 블라인드 채용
- 팁
- STL
- 17837
- 게리맨더링 2
- 삼성
- 17779
- 미세먼지 안녕!
- 새로운 게임 2
- 2018 KAKAO BLIND RECRUITMENT
- DFS
- scanf
- 역량 테스트
- 입출력
- SW Expert Academy
- string
- SWEA
- boj
- 트렌드
- 알고리즘
- 이차원 배열과 연산
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |