백준 문제풀이

baekjoon - python - 11050

winston1214 2020. 9. 13. 16:24
반응형

www.acmicpc.net/problem/11050

 

11050번: 이항 계수 1

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

www.acmicpc.net

# @Author YoungMinKim
# baekjoon
def factorial(N):
    if N == 1:
        return 1
    elif N == 0:
        return 1
    else:
        return N*factorial(N-1)
N,K = map(int,input().split())
print(int(factorial(N)/(factorial(N-K)*factorial(K))))

 

 

 

반응형