코테 공부/백준

[Python] 2407 조합 (쉬움)

prefer_all 2022. 8. 19. 14:38
문제

 

nCm을 출력한다.

 

입력

 

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

 

출력

 

nCm을 출력한다.

예제 입력 예제 출력
100 6 1192052400

풀이
import math

n, m = map(int,input().split())
ans = math.factorial(n)// (math.factorial(m)* math.factorial(n-m))
print(ans)