알고리즘/백준
[Python] 백준 파이썬 11050 이항 계수 1
dding96
2022. 10. 12. 07:55
https://www.acmicpc.net/problem/11050
11050번: 이항 계수 1
첫째 줄에 \(N\)과 \(K\)가 주어진다. (1 ≤ \(N\) ≤ 10, 0 ≤ \(K\) ≤ \(N\))
www.acmicpc.net
# 백준 11050 이항 계수 1
import math
n, k = map(int, input().split())
print(math.comb(n,k))
python에는 math.comb() 라는 아주 좋은 함수가 있습니다. 😀