본문 바로가기
Algorithm(BOJ, Python)/Mathematics

[백준_11051] 이항 계수 2 python

by kurooru 2022. 7. 12.

dp로 해결하지 말자 이런건

고등학교때 확률과 통계 열심히 배워놓자

다 도움이 된다.

# math 라이브러리 사용
import math

# n, k 입력
n, k = map(int, input().split())

# 출력
print((math.factorial(n) // (math.factorial(k) * math.factorial(n-k))) % 10007)

'Algorithm(BOJ, Python) > Mathematics' 카테고리의 다른 글

[백준_13239] Combinations python  (0) 2022.07.31
[백준_9655] 돌게임 python  (0) 2022.07.16
[백준_1010] 다리놓기 python  (0) 2022.07.12
[백준_10407] 2타워 python  (0) 2022.06.13