-코드
from math import factorial
n, k = map(int, input().split())
r = factorial(n) // (factorial(n - k) * factorial(k))
print(r)
팩토리얼 함수가 있어서 사용하여 이항계수를 풀었습니다.
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬]13222번 Matches (0) | 2021.04.10 |
---|---|
[백준/파이썬]15178번 Angles (0) | 2021.04.10 |
[백준/파이썬]15829번 Hashing (0) | 2021.04.09 |
[백준/파이썬]7891번 Can you add this? (0) | 2021.04.09 |
[백준/파이썬]10180번 Ship Selection (0) | 2021.04.09 |