Search
Duplicate
๐Ÿฅˆ

์ดํ•ญ ๊ณ„์ˆ˜ 2

์ฃผ์ฐจ
17
๋ฌธ์ œ๋ฒˆํ˜ธ
11051
์–ธ์–ด
Python
ํ‹ฐ์–ด
์‹ค๋ฒ„
์œ ํ˜•
DP
nj_Blog
O
nj_์ƒํƒœ
์™„๋ฃŒ
์ดํ•ด๋„
ํ’€์ด
์‚ฌ๋žŒ
์ดํ•ด๋„ 2
13 more properties

๋ฌธ์ œ๋งํฌ

https://www.acmicpc.net/problem/11051

์ฝ”๋“œ ์ œ์ถœ ๊ธฐ๋ก (๋ฉ”๋ชจ๋ฆฌ ๋ฐ ์‹œ๊ฐ„)

์ œ์ถœ ๋‚ ์งœ

@4/23/2021

๋ฉ”๋ชจ๋ฆฌ

204292 KB

์‹œ๊ฐ„

268 ms

๋ฉ”๋ชจ

โ€ข

๋ฌธ์ œํ’€์ด

k ๊ฐ€ 0 ์ผ๋•Œ! ๋นผ๋จน์ง€ ์•Š์„ ๊ฒƒ!!

Code

์žฌ๊ท€๋กœ ํ‘ธ๋‹ˆ๊นŒ ์‹œ๊ฐ„์ดˆ๊ณผ๋‚จ...ใ… 
N, K = map(int, input().split()) def recursion(n, k): if n == k: return 1 if k == 1: return n return recursion(n-1, k-1) + recursion(n-1, k) print(recursion(N, K))
Python
๋ณต์‚ฌ

์ œ์ถœ ๋‚ ์งœ

@4/23/2021

๋ฉ”๋ชจ๋ฆฌ

204292 KB

์‹œ๊ฐ„

268 ms
N, K = map(int, input().split()) dp = [[0 for _ in range(N+1)] for _ in range(N+1)] for i in range(0, N+1): for j in range(0, N+1): if j == 0: dp[i][j] = 1 elif i == j: dp[i][j] = 1 elif j == 1: dp[i][j] = i elif N >= K: dp[i][j] = dp[i-1][j-1] + dp[i-1][j] print(dp[N][K] % 10007)
Python
๋ณต์‚ฌ

์ฐธ๊ณ