https://www.acmicpc.net/problem/2407 2407번: 조합 n과 m이 주어진다. (5 ≤ n ≤ 100, 5 ≤ m ≤ 100, m ≤ n) www.acmicpc.net 정답 code # 조합 import math # nCm = n! / (n-m)! *m! n,m = map(int,input().split()) top = math.factorial(n) bottom = (math.factorial(n-m)) * (math.factorial(m)) print(top//bottom) solution math모듈에 factorial 함수를 이용하여 쉽게 구현 하였다. nCm = n! / (n-m)! * m!를 위아래로 나눠 계산후 출력해주면 된다.