(백준) 2407 – 콤비네이션 (Python)

쉬운 목차

문제

#2407: 조합(acmicpc.net)

2407호:조합

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

www.acmicpc.net

설명

이것은 또한 Python에서 매우 유익한 문제입니다.


아래 계승으로 nCr을 쉽게 구현할 수 있습니다.

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