[백준/파이썬] 11051번

민정·2024년 1월 28일
0

[백준/파이썬]

목록 보기
243/245
post-thumbnail

📍백준 11051 문제

https://www.acmicpc.net/problem/11051

코드

import sys
input = sys.stdin.readline
n, k = map(int, input().split())
temp1 = 1
temp2 = 1
for i in range(k, 0, -1):
    temp1 = temp1*n
    n -= 1
    temp2 = temp2*i

print((temp1//temp2) % 10007)

풀이

조합의 원풀이대로 풀었습니다.
n x(n-1)x(n-2)...(n-k+1)/k!

profile
パㅔバ6ㅇr 덤벼ㄹΓ :-0

0개의 댓글