algorithm'''problem solve
[백준] 2407 - 조합
JunHwa Park
2020. 10. 27. 13:04
https://www.acmicpc.net/problem/2407
2407번: 조합
n과 m이 주어진다. (5 ≤ n ≤ 100, 5 ≤ m ≤ 100, m ≤ n)
www.acmicpc.net
1
2
3
4
|
from math import factorial
n, m = map(int, input().split())
print(factorial(n) // (factorial(n - m) * factorial(m)))
|
cs |
그냥 하라는거 하면 된다.
혹시 조합 nCr 계산을 못하는 분이 계실까 하여 추가로 공식을 알려드리면