From 4b6cb2d0ef1ee55cdac14b2cb128afd0b3a105ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=88=98=ED=98=84?= Date: Mon, 8 Apr 2024 18:52:07 +0900 Subject: [PATCH] =?UTF-8?q?2024-04-06=20=ED=94=BC=EB=B3=B4=EB=82=98?= =?UTF-8?q?=EC=B9=98=20=EC=88=98=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suhyun113/DP/4-suhyun113.py | 9 +++++++++ suhyun113/README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 suhyun113/DP/4-suhyun113.py diff --git a/suhyun113/DP/4-suhyun113.py b/suhyun113/DP/4-suhyun113.py new file mode 100644 index 0000000..183d20f --- /dev/null +++ b/suhyun113/DP/4-suhyun113.py @@ -0,0 +1,9 @@ +memo = [0, 1] + +n = int(input()) +def fibo(n): + if n >= 2 and n >= len(memo): + memo.append(fibo(n-1)+fibo(n-2)) + return memo[n] + +print(fibo(n)) \ No newline at end of file diff --git a/suhyun113/README.md b/suhyun113/README.md index b25f4a7..f3aaba3 100644 --- a/suhyun113/README.md +++ b/suhyun113/README.md @@ -4,4 +4,5 @@ |:----:|:---------:|:----:|:-----:|:----:| | 1차시 | 2024.03.25 | 그리디 | [체육복](https://school.programmers.co.kr/learn/courses/30/lessons/42862) | [#2](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/2) | | 2차시 | 2024.03.29 | 수학 | [소수 & 팰린드롬](https://www.acmicpc.net/problem/1747) | [#9](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/9) | -| 3차시 | 2024.04.02 | 그리디 | [거스름돈](https://www.acmicpc.net/problem/14916) | [#12](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/12) | \ No newline at end of file +| 3차시 | 2024.04.02 | 그리디 | [거스름돈](https://www.acmicpc.net/problem/14916) | [#12](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/12) | +| 4차시 | 2024.04.06 | DP | [피보나치 수 5](https://www.acmicpc.net/problem/10870) | [#16](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/16) | \ No newline at end of file