Post

[BOJ] 11050. ์ดํ•ญ ๊ณ„์ˆ˜ 1(python)

๐Ÿ“Œ๋ฌธ์ œ

Alt text

๐Ÿ’ช์•„์ด๋””์–ด

$$ \begin{pmatrix} N\\ K \end{pmatrix} = {}_n \mathrm{ C }_k =\frac{n!}{r!(n-r)!} $$

์ฝค๋น„๋„ค์ด์…˜์„ ๊ณ„์‚ฐํ•  ์ˆ˜ ์žˆ๋Š” ํŒŒ์ด์ฌ์˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ math.combination์ด ์žˆ๋‹ค.


๐Ÿฅ‚์ฝ”๋“œ

1
2
3
4
from math import comb
n, k = map(int,input().split())
answer = comb(n,k)
print(answer)
This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.