diff --git "a/YIM2UL2ET/DP/17\354\260\250\354\213\234 - BOJ11726.cpp" "b/YIM2UL2ET/DP/17\354\260\250\354\213\234 - BOJ11726.cpp" new file mode 100644 index 0000000..da0dd7f --- /dev/null +++ "b/YIM2UL2ET/DP/17\354\260\250\354\213\234 - BOJ11726.cpp" @@ -0,0 +1,20 @@ +#include +#include + +std::vector dp(1000); + +int func(int n) { + if (dp[n-1] == 0) { + dp[n-1] = (func(n-1) + func(n-2)) % 10007; + } + return dp[n-1]; +} + +int main(void) { + dp[0] = 1, dp[1] = 2; + + int n; + std::cin >> n; + std::cout << func(n); + return 0; +} \ No newline at end of file diff --git a/YIM2UL2ET/README.md b/YIM2UL2ET/README.md index 785ddc5..d868578 100644 --- a/YIM2UL2ET/README.md +++ b/YIM2UL2ET/README.md @@ -17,5 +17,7 @@ | 13차시 | 2024.04.01 | BFS | [BOJ 7569](https://www.acmicpc.net/problem/7569) | [BOJ 7569 풀이](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/42) | | 14차시 | 2024.04.04 | 우선순위 큐 | [BOJ 11286](https://www.acmicpc.net/problem/11286) | [BOJ 11286 풀이](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/43) | | 15차시 | 2024.04.09 | 구현 | [BOJ 14719](https://www.acmicpc.net/problem/14719) | [BOJ 14719 풀이](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/48) | -| 16차시 | 2024.04.09 | 구현 | [BOJ 15927](https://www.acmicpc.net/problem/15927) | [BOJ 15927 풀이](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/51) | +| 16차시 | 2024.04.11 | 애드 혹 | [BOJ 15927](https://www.acmicpc.net/problem/15927) | [BOJ 15927 풀이](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/51) | +| 17차시 | 2024.04.15 | DP | [BOJ 11726](https://www.acmicpc.net/problem/11726) | [BOJ 11726 풀이](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/53) | + --- \ No newline at end of file