From 19c275d1e0802c192d43ac920358a37ba1b1ebdb Mon Sep 17 00:00:00 2001 From: seongwon030 <105052068+seongwon030@users.noreply.github.com> Date: Tue, 7 May 2024 17:26:53 +0900 Subject: [PATCH] =?UTF-8?q?2024-05-07=202225=20=ED=95=A9=EB=B6=84=ED=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DP/\355\225\251\353\266\204\355\225\264.py" | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 "seongwon030/DP/\355\225\251\353\266\204\355\225\264.py" diff --git "a/seongwon030/DP/\355\225\251\353\266\204\355\225\264.py" "b/seongwon030/DP/\355\225\251\353\266\204\355\225\264.py" new file mode 100644 index 0000000..13e1241 --- /dev/null +++ "b/seongwon030/DP/\355\225\251\353\266\204\355\225\264.py" @@ -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]) \ No newline at end of file