본문 바로가기

반응형

Algorithm_BOJ(백준)/깊이,너비우선탐색(DFS,BFS)

(47)
[백준 5014 c++ V] 스타트링크 - 풀이 링크: https://github.com/xhaktmchl/Algorithm_study/blob/main/BOJ/%EB%84%88%EB%B9%84%2C%EA%B9%8A%EC%9D%B4%EC%9A%B0%EC%84%A0%ED%83%90%EC%83%89(DFS%2CBFS)/%5B%EB%B0%B1%EC%A4%80%205014%20c%2B%2B%20V%5D%20%EC%8A%A4%ED%83%80%ED%8A%B8%EB%A7%81%ED%81%AC.cpp GitHub - xhaktmchl/Algorithm_study: 알고리즘 이론 및 문제풀이 알고리즘 이론 및 문제풀이. Contribute to xhaktmchl/Algorithm_study development by creating an account on ..
[백준 5568 c++ V] 카드 놓기 - 풀이 링크: https://github.com/xhaktmchl/Algorithm_study/blob/main/BOJ/%EB%84%88%EB%B9%84%2C%EA%B9%8A%EC%9D%B4%EC%9A%B0%EC%84%A0%ED%83%90%EC%83%89(DFS%2CBFS)/%5B%EB%B0%B1%EC%A4%80%205568%20c%2B%2B%20V%5D%20%EC%B9%B4%EB%93%9C%20%EB%86%93%EA%B8%B0.cpp GitHub - xhaktmchl/Algorithm_study: 알고리즘 이론 및 문제풀이 알고리즘 이론 및 문제풀이. Contribute to xhaktmchl/Algorithm_study development by creating an account on GitHub..
[백준 11724 c++ OOO] 연결 요소의 개수 - 풀이 github: https://github.com/xhaktmchl/Algorithm_study/blob/main/BOJ/%EB%84%88%EB%B9%84%2C%EA%B9%8A%EC%9D%B4%EC%9A%B0%EC%84%A0%ED%83%90%EC%83%89(DFS%2CBFS)/%5B%EB%B0%B1%EC%A4%80%2011724%20c%2B%2B%20OOO%5D%20%EC%97%B0%EA%B2%B0%20%EC%9A%94%EC%86%8C%EC%9D%98%20%EA%B0%9C%EC%88%98.cpp GitHub - xhaktmchl/Algorithm_study: 알고리즘 이론 및 문제풀이 알고리즘 이론 및 문제풀이. Contribute to xhaktmchl/Algorithm_study develop..
[백준 14940 c++ O] 쉬운 최단거리 풀이 github: https://github.com/xhaktmchl/Algorithm_study/blob/main/BOJ/%EB%84%88%EB%B9%84%2C%EA%B9%8A%EC%9D%B4%EC%9A%B0%EC%84%A0%ED%83%90%EC%83%89(DFS%2CBFS)/%5B%EB%B0%B1%EC%A4%80%2014940%20c%2B%2B%20O%5D%20%EC%89%AC%EC%9A%B4%20%EC%B5%9C%EB%8B%A8%EA%B1%B0%EB%A6%AC.cpp GitHub - xhaktmchl/Algorithm_study: 알고리즘 이론 및 문제풀이 알고리즘 이론 및 문제풀이. Contribute to xhaktmchl/Algorithm_study development by creating..
[백준 1697 c++ VVOO] 숨바꼭질 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 #define _CRT_SECURE_NO_WARNINGS #include #include #include #include using namespace std; // [백준 1697 c++ VVOO] 숨바꼭질 // 문제: n에서 k 까지 걸리는 최소시간을 구해라 // 접근: 최소이동횟수 -> 완탐,그리디,dp,bfs-> 완탐은 시간 3^10만 = 시간초과 // 접근2: bfs -> dist배열에 이동거리 저장하..
[백준 2606 c++ VOO] 바이러스 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 #define _CRT_SECURE_NO_WARNINGS #include #include #include #include using namespace std; // [백준 2606 c++ VOO] 바이러스 // 문제: 1번 컴퓨터를 통해 감염되는 컴퓨터의 갯수 구하기 // 접근1: 기본 인접행렬 dfs : 연결된 노드탐색 // 풀이: // 2차원 연결리스트 인접행렬 만들기 // 1부터 시작해서 dfs 탐색하며 감염 컴퓨터의 수 구하기 #define MAX 101 int n, edge..
[백준 13549 c++ VO] 숨바꼭질 3 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 #define _CRT_SECURE_NO_WARNINGS #include #include #include #include using namespace std; // [백준 13549 c++ VO] 숨바꼭질 3 // 문제: // 접근1: 최소시간 ->1차원 ,완탐 -> 시간복잡도 3^n 시간초과 예상 // 접근2: 최소시간 -> 완탐,그리디,dp,bfs-> ..
[백준 13913 c++ VV] 숨바꼭질 4 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 #define _CRT_SECURE_NO_WARNINGS #include #include #include #include using namespace std; // [백준 13913 c++ VV] 숨바꼭질 4 // 문제: n에서 k 까지 걸리는 최소시간, 탐색 과정을 구해라 // 접근: 최소이동횟수 -> 완탐..

반응형