Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 그래프
- 브루트포스
- 북리뷰
- 자료구조
- 너비우선탐색
- 스택
- vector
- Operating System
- 컴공
- Computer science
- c++
- 코테
- 알고리즘
- 백준
- DP
- 정석학술정보관
- 컴공과
- 개발
- OS
- 구현
- 정석
- 오퍼레이팅시스템
- bfs
- 오에스
- cs
- Stack
- 문제풀이
- 컴퓨터공학과
- coding
- 코딩
Archives
- Today
- Total
목록recursion (2)
Little Jay
[C++] 백준 9009번 - 피보나치
피보나치를 이용한 재귀 문제였다. Zeckendorf's theorem을 사용하는 문제였는데, 이분의 블로그를 보면 쉽게 이해가 가능하다. 결과적으로 피보나치 수가 n 보다 클 때 직전항을 빼주면서 재귀적으로 내려가면 된다. #include using namespace std; long long fibo[10000001]; void solve(int n) { if (n == 0) return; for (int i = 0; i n; solve(n); cout
알고리즘/BOJ
2022. 7. 25. 16:46
[C++] 백준 15650번 - N과 M(2)
백트래킹에 들어가있지만, DFS로 풀 수 있는것 같다. 둘이 조금은 비슷한 성향을 가진 문제인 것 같다. #include #include #define MAX 9 using namespace std; int n, m; int arr[MAX] = { 0, }; bool visited[MAX] = { 0, }; void dfs(int num, int cnt) { if (cnt == m) { for (int i = 0; i < m; i++) cout m; dfs(1, 0); return 0; }
알고리즘/BOJ
2021. 11. 6. 15:36