728x90

BOJ 2407 조합

문제

시간 제한 : 2 초
메모리 제한 : 128 MB

입력

n과 m이 주어진다. (5 ≤ n ≤ 100, 5 ≤ m ≤ 100, m ≤ n)

출력

예제 입력 1

100 6

예제 출력 1

1192052400

풀이

# boj 2407 조합
import math

n, m = map(int, input().split())
numer = math.factorial(n)
deno = (math.factorial(n-m)) * (math.factorial(m))

print(numer//deno)

 

728x90

+ Recent posts