Skip to content

Commit

Permalink
2024-03-22
Browse files Browse the repository at this point in the history
  • Loading branch information
H0ngJu committed Mar 22, 2024
1 parent dc35c20 commit b484dfa
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 @@ -3,5 +3,6 @@
| ์ฐจ์‹œ | ๋‚ ์งœ | ๋ฌธ์ œ์œ ํ˜• | ๋งํฌ | ํ’€์ด |
| :---: | :--------: | :------: | :-------------------------------------------------------------------------: | :-------------------------------------------------: |
| 1์ฐจ์‹œ | 2024.03.05 | ํ | [ํ”„๋กœ์„ธ์Šค](https://school.programmers.co.kr/learn/courses/30/lessons/42587) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/151 |
| 1์ฐจ์‹œ | 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 b484dfa

Please sign in to comment.