We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddc9723 commit 3b54883Copy full SHA for 3b54883
1 file changed
김지호/1주차/260103.py
@@ -0,0 +1,27 @@
1
+import sys
2
+import copy
3
+from collections import deque
4
+
5
+sys.stdin = open('../input.txt', 'r')
6
7
+N, K = map(int,input().split(" "))
8
9
+DIVIDER = 1000000000
10
11
+# 2차원 DP[N][K] -> 각 DP[i][j] : i개의 수로 j를 만들 수 있는 값
12
+# 최종 : DP[N][K] 구하기
13
+dp = [[1] * (N+1) for _ in range(K+1)]
14
15
+# print2d_arr(dp)
16
17
+# 초기화
18
+for col in range(N+1):
19
+ dp[0][col] = 0
20
21
+for row in range(2,K+1):
22
+ for col in range(1,N+1):
23
+ dp[row][col] = (dp[row][col-1] + dp[row-1][col]) % DIVIDER
24
25
26
+print(dp[K][N])
27
0 commit comments