백준 풀이

백준 1010번 파이썬

ag2개발자 2022. 8. 26. 15:13
# from itertools import combinations
# n=int(input())
# for _ in range(n):
#     arr=[]
#     a,b=map(int,input().split())
#     for i in range(b):
#         arr.append(i)
#     arr2 = combinations(arr,a)
#     print(len(list(arr2)))
#시간초과
from math import factorial
n=int(input())
for _ in range(n):
    p,q=map(int,input().split())
    res= factorial(q)//(factorial(p)*factorial(q-p))
    print(res)

'백준 풀이' 카테고리의 다른 글

백준 1789번 파이썬  (0) 2022.08.26
백준 1475번 파이썬  (0) 2022.08.26
백준 11723번 파이썬  (0) 2022.08.26
백준 11651번 파이썬  (0) 2022.08.26
백준 11866번 파이썬  (0) 2022.08.26