본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 11051번 이항 계수 2

by 현장 2022. 5. 7.

-Code

from math import factorial
n, k = map(int, input().split())
print(factorial(n) // (factorial(n - k) * factorial(k)) % 10007)

이항계수 식을 찾아서 해결했습니다.