Skip to content

Commit

Permalink
Merge pull request #166 from AlgoLeadMe/7-H0ngJu
Browse files Browse the repository at this point in the history
7-H0ngJu
  • Loading branch information
H0ngJu authored Mar 27, 2024
2 parents b06f1cb + 30874a9 commit 91b36eb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions H0ngJu/DP/1,2,3 ๋”ํ•˜๊ธฐ.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import sys

def input(): return sys.stdin.readline().strip()

T = int(input())

answer = []
dp = [0] * (11)

for index in range(T):
data = int(input())

for i in range(1, data + 1):
if i == 1:
dp[i] = 1
elif i == 2:
dp[i] = 2
elif i == 3:
dp[i] = 4
else:
dp[i] = dp[i-1] + dp[i-2] + dp[i-3]

answer.append(dp[data])

for a in answer:
print(a, end=" ")
1 change: 1 addition & 0 deletions H0ngJu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
| 4์ฐจ์‹œ | 2024.03.13 | ํž™ | [๋ฌธ์ œ์ง‘](https://www.acmicpc.net/problem/1766) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/158 |
| 5์ฐจ์‹œ | 2024.03.16 | ๊ตฌํ˜„ | [์š”์„ธํ‘ธ์Šค ๋ฌธ์ œ](https://www.acmicpc.net/problem/1158) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/161 |
| 6์ฐจ์‹œ | 2024.03.19 | ์Šคํƒ | [์˜คํฐ์ˆ˜](https://www.acmicpc.net/problem/17298) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/164 |
| 7์ฐจ์‹œ | 2024.03.22 | DP | [1,2,3 ๋”ํ•˜๊ธฐ](https://www.acmicpc.net/problem/9095) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/166 |

---

0 comments on commit 91b36eb

Please sign in to comment.