백준 :: 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]) {..
BOJ :: 백준 :: 1937 :: 욕심쟁이 판다 출처 : https://www.acmicpc.net/problem/1937 #include #include using namespace std; int N, ans;int map[501][501], dp[501][501];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 < N) ? true : false); } int dfs(int i, int j) {if (dp[i][j]) return dp[i][j];dp[i][j] = 1;for (int d = 0; d < 4; d++) {int n..
BOJ::15683::감시 출처 : https://www.acmicpc.net/problem/15683 #include using namespace std; int N, M, vs, a[8][8], ans,dy[] = { -1,0,1,0 }, dx[] = { 0,1,0,-1 }, nc[6] = { 0,1,2,2,3,4 }, cc[6][4] = { {},{0},{0,2},{0,1},{0,1,3},{0,1,2,3} };vector v; int cal(int vi, int res) {if (vi == vs) return res;int ta[8][8], tmp = 65; memcpy(ta, a, sizeof(a));auto tp = v[vi];for(int i=0;i= 0 && nx < M&&a[ny][nx] ..
출처 : https://www.acmicpc.net/problem/9466 #include #include #include using namespace std; int N, arr[100001], result;bool check[100001], e[100001]; void dfs(int now){check[now] = true;if (check[arr[now]]){if (!e[arr[now]]){for (int i = arr[now]; i != now; i = arr[i]) result++;result++;}}else dfs(arr[now]);e[now] = true;} int main(){int t = 1; int T;cin >> T;while (T--){result = 0; memset(arr, 0,..
- Total
- Today
- Yesterday
- 트렌드
- DFS
- 팁
- 17837
- 17143
- 17144
- 역량 테스트
- SW Expert Academy
- 2018 KAKAO BLIND RECRUITMENT
- 17779
- STL
- hackerrank
- 게리맨더링 2
- 17140
- 백준
- 미세먼지 안녕!
- 새로운 게임 2
- 이차원 배열과 연산
- 2018 카카오 블라인드 채용
- 연구소 3
- scanf
- DP
- 삼성
- 17142
- string
- boj
- SWEA
- 시간 복잡도
- 알고리즘
- 입출력
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 |
30 | 31 |