🗝️ Algorithm/🟩 백준
🟩 [백준] [Python] Class3_2407번_ 조합
Dbswnstjd
2022. 10. 31. 02:16
문제
https://www.acmicpc.net/problem/2407
2407번: 조합
n과 m이 주어진다. (5 ≤ n ≤ 100, 5 ≤ m ≤ 100, m ≤ n)
www.acmicpc.net
풀이
# 백준 2407번 문제 - 조합
import math
n, m = map(int, input().split())
print(int(math.factorial(n) // (math.factorial(m)*math.factorial(n-m))))
factorial 함수를 사용하면 매우 쉽게 풀 수 있는 문제였다.