From b2c85a2cf448520990814ec020b5573f2ec125b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9E=84=EC=8A=B9=ED=98=B8?= <132066506+YIM2UL2ET@users.noreply.github.com> Date: Tue, 16 Apr 2024 00:00:23 +0900 Subject: [PATCH] =?UTF-8?q?17=EC=B0=A8=EC=8B=9C=20=EC=97=85=EB=A1=9C?= =?UTF-8?q?=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...17\354\260\250\354\213\234 - BOJ11726.cpp" | 20 +++++++++++++++++++ YIM2UL2ET/README.md | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 "YIM2UL2ET/DP/17\354\260\250\354\213\234 - BOJ11726.cpp" 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