[백준-2407] 조합 / Python
📚 Problem Solving/Baekjoon
https://www.acmicpc.net/problem/2407
2407번: 조합
n과 m이 주어진다. (5 ≤ n ≤ 100, 5 ≤ m ≤ 100, m ≤ n)
www.acmicpc.net
import sys
import math
input = sys.stdin.readline
n, m = map(int, input().split())
print(math.factorial(n) // (math.factorial(n - m) * math.factorial(m)))
해설
공식만 알면 간단히 해결!
'📚 Problem Solving > Baekjoon' 카테고리의 다른 글
[백준-11052] 카드 구매하기 / Python (0) | 2021.06.18 |
---|---|
[백준-18353] 병사 배치하기 / Python (0) | 2021.06.04 |
[백준-1629] 곱셈 / Python (0) | 2021.06.01 |
[백준-1991] 트리 순회 / Python (0) | 2021.06.01 |
[백준-16236] 아기 상어 / Python (0) | 2021.05.31 |