From 4e2386cce5ebdce686871552de923aadbce4f85c Mon Sep 17 00:00:00 2001 From: yubin Date: Wed, 4 Sep 2024 01:09:10 +0900 Subject: [PATCH] 58-xxubin04 --- ..._1,2,3 \353\215\224\355\225\230\352\270\260.py" | 14 ++++++++++++++ xxubin04/README.md | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 "xxubin04/DP/9095_1,2,3 \353\215\224\355\225\230\352\270\260.py" diff --git "a/xxubin04/DP/9095_1,2,3 \353\215\224\355\225\230\352\270\260.py" "b/xxubin04/DP/9095_1,2,3 \353\215\224\355\225\230\352\270\260.py" new file mode 100644 index 0000000..87a70e0 --- /dev/null +++ "b/xxubin04/DP/9095_1,2,3 \353\215\224\355\225\230\352\270\260.py" @@ -0,0 +1,14 @@ +input = open(0).readline + +def dp(value): + if value == 1: + return(1) + elif value == 2: + return(2) + elif value == 3: + return(4) + else: + return dp(value-3)+dp(value-2)+dp(value-1) + +for i in range(n := int(input())): + print(dp(int(input()))) \ No newline at end of file diff --git a/xxubin04/README.md b/xxubin04/README.md index c17d154..7fd7a72 100644 --- a/xxubin04/README.md +++ b/xxubin04/README.md @@ -56,4 +56,6 @@ | 52차시 | 2024.07.05 | 구현 | [2019 카카오 인턴십]튜플 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/198 | | 53차시 | 2024.07.08 | DP | [2193]이친수 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/200 | | 54차시 | 2024.07.11 | Tree | [1991]트리 순회 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/203 | -| 55차시 | 2024.07.29 | 정렬 | [Programmers]H-Index | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/208 | \ No newline at end of file +| 55차시 | 2024.07.29 | 정렬 | [Programmers]H-Index | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/208 | +| 55차시 | 2024.07.29 | 정렬 | [Programmers]H-Index | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/208 | +| 58차시 | 2024.09.04 | DP | [9095]1,2,3 더하기 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/219 | \ No newline at end of file