본문 바로가기

알고리즘/백준

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

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

 

11051번: 이항 계수 2

첫째 줄에 \(N\)과 \(K\)가 주어진다. (1 ≤ \(N\) ≤ 1,000, 0 ≤ \(K\) ≤ \(N\))

www.acmicpc.net

# 백준 파이썬 11051 이항 계수 2
import math

n, k = map(int, input().split())
ans = math.comb(n, k)
ans %= 10007

print(ans)