Skip to content

Commit

Permalink
Merge pull request #44 from AlgoLeadMe/11-seongwon
Browse files Browse the repository at this point in the history
11-seongwon
  • Loading branch information
seongwon030 authored May 19, 2024
2 parents 5d80818 + 19c275d commit bd75fbf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions seongwon030/DP/합분해.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
n,k = map(int,input().split())

mod = 1000000000

dp = [[0] * (n+1) for _ in range(k+1)] # 2차원 배열
dp [0][0] = 1 # 초기값 설정

for i in range(1,k+1):
for j in range(n+1):
dp[i][j] = dp[i-1][j] + dp[i][j-1]
dp[i][j] = dp[i][j] % mod

print(dp[k][n])

0 comments on commit bd75fbf

Please sign in to comment.